jclib-ui 1.0.286 → 1.0.288

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5734,12 +5734,12 @@ function useApi(initialConfig = {}) {
5734
5734
  }
5735
5735
  }
5736
5736
  async function callRequest(localConfig) {
5737
- var _a, _b, _c, _d, _e2;
5737
+ var _a, _b, _c, _d;
5738
5738
  let response;
5739
- let auth = {
5740
- username: (_a = globalApiConfig.auth) == null ? void 0 : _a.username,
5741
- password: (_b = globalApiConfig.auth) == null ? void 0 : _b.password
5742
- };
5739
+ let auth = ((_a = globalApiConfig.auth) == null ? void 0 : _a.username) ? {
5740
+ username: globalApiConfig.auth.username,
5741
+ password: globalApiConfig.auth.password
5742
+ } : void 0;
5743
5743
  initialConfig.headers = { ...initialConfig.headers, ...localConfig == null ? void 0 : localConfig.headers };
5744
5744
  if (globalApiConfig.getToken) {
5745
5745
  let token = globalApiConfig.getToken();
@@ -5796,8 +5796,8 @@ function useApi(initialConfig = {}) {
5796
5796
  ...initialRequestInfo,
5797
5797
  isError: true,
5798
5798
  status: err.response.status,
5799
- message: ((_c = err.response.data) == null ? void 0 : _c.error) || err.response.data,
5800
- code: (_d = err.response.data) == null ? void 0 : _d.code
5799
+ message: ((_b = err.response.data) == null ? void 0 : _b.error) || err.response.data,
5800
+ code: (_c = err.response.data) == null ? void 0 : _c.code
5801
5801
  };
5802
5802
  switch (err.response.status) {
5803
5803
  case 400:
@@ -5822,7 +5822,11 @@ function useApi(initialConfig = {}) {
5822
5822
  break;
5823
5823
  }
5824
5824
  case 405: {
5825
- response.message = `Método [${((_e2 = finalConfig.method) == null ? void 0 : _e2.toUpperCase()) || "GET"}] indisponível!`;
5825
+ response.message = `Método [${((_d = finalConfig.method) == null ? void 0 : _d.toUpperCase()) || "GET"}] indisponível!`;
5826
+ break;
5827
+ }
5828
+ case 429: {
5829
+ response.message = "Muitos acessos. Tente novamente mais tarde!";
5826
5830
  break;
5827
5831
  }
5828
5832
  }