@zauru-sdk/hooks 2.0.151 → 2.0.153
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.
- package/dist/catalogs.d.ts +5 -1
- package/dist/esm/catalogs.js +5 -3
- package/dist/esm/templates.js +2 -2
- package/package.json +5 -5
package/dist/catalogs.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgencyGraphQL, BitacoraPOMassive, BundleGraphQL, CaseGraphQL, CurrencyGraphQL, EmployeeGraphQL, FormGraphQL, InvoiceGraphQL, ItemCategoryGraphQL, ItemGraphQL, LotStockGraphQL, MotivoRechazo, PayeeCategoryGraphQL, PayeeGraphQL, PaymentTermGraphQL, ReceptionType, ShipmentGraphQL, SubmissionCasesGraphQL, SubmissionInvoicesGraphQL, SuggestedPriceGraphQL, Template, TipoMuestra, WebAppRowGraphQL, PrintTemplateGraphQL, PaymentMethodGraphQL } from "@zauru-sdk/types";
|
|
1
|
+
import type { AgencyGraphQL, BitacoraPOMassive, BundleGraphQL, CaseGraphQL, CurrencyGraphQL, EmployeeGraphQL, FormGraphQL, InvoiceGraphQL, ItemCategoryGraphQL, ItemGraphQL, LotStockGraphQL, MotivoRechazo, PayeeCategoryGraphQL, PayeeGraphQL, PaymentTermGraphQL, ReceptionType, ShipmentGraphQL, SubmissionCasesGraphQL, SubmissionInvoicesGraphQL, SuggestedPriceGraphQL, Template, TipoMuestra, WebAppRowGraphQL, PrintTemplateGraphQL, PaymentMethodGraphQL, CCPorcentajeRechazo } from "@zauru-sdk/types";
|
|
2
2
|
import { CATALOGS_NAMES, ReduxParamsConfig } from "@zauru-sdk/redux";
|
|
3
3
|
type CatalogType<T> = {
|
|
4
4
|
data: T[];
|
|
@@ -155,6 +155,10 @@ export declare const useGetMotivosDeRechazo: (config?: ReduxParamsConfig) => {
|
|
|
155
155
|
loading: boolean;
|
|
156
156
|
data: WebAppRowGraphQL<MotivoRechazo>[];
|
|
157
157
|
};
|
|
158
|
+
export declare const useGetCCPorcentajesDeRechazo: (config?: ReduxParamsConfig) => {
|
|
159
|
+
loading: boolean;
|
|
160
|
+
data: WebAppRowGraphQL<CCPorcentajeRechazo>[];
|
|
161
|
+
};
|
|
158
162
|
export declare const useGetBitacoraRechazoMasivo: (config?: ReduxParamsConfig) => {
|
|
159
163
|
loading: boolean;
|
|
160
164
|
data: WebAppRowGraphQL<BitacoraPOMassive>[];
|
package/dist/esm/catalogs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useGetInvoiceFormSubmissionsByInvoiceId = exports.useGetMyCaseFormSubmissions = exports.useGetInvoiceFormSubmissionsByAgencyId = exports.useGetCaseForms = exports.useGetInvoiceForms = exports.useGetAllForms = exports.useGetBitacoraRechazoMasivo = exports.useGetMotivosDeRechazo = exports.useGetTiposDeMuestra = exports.useGetInvoicesByCurrentAgency = exports.useGetInvoicesByLab = exports.useGetShipmentsToMyAgency = exports.useGetEmployees = exports.useGetEmployeesByCurrentAgency = exports.useGetEmployeesByLab = exports.useGetPaymentMethods = exports.useGetPaymentTerms = exports.useGetSuggestedPrices = exports.useGetAgencies = exports.useGetPrintTemplates = exports.useGetPayeesForLab = exports.useGetPayees = exports.useGetClientCategories = exports.useGetProviderCategories = exports.useGetMyCases = exports.useGetProviders = exports.useGetReceptionTypes = exports.useGetCurrencies = exports.useGetBundlesForLab = exports.useGetBundlesRecipForLab = exports.useGetPayeeCategoriesLabPrices = exports.useGetPayeeCategories = exports.useGetTemplates = exports.useGetBookings = exports.useGetItemCategoriesForLab = exports.useGetItemServicesByLab = exports.useGetMyAgencyLotStocks = exports.useGetItemsByLab = exports.useGetItemsByReception = exports.useGetItems = void 0;
|
|
3
|
+
exports.useGetInvoiceFormSubmissionsByInvoiceId = exports.useGetMyCaseFormSubmissions = exports.useGetInvoiceFormSubmissionsByAgencyId = exports.useGetCaseForms = exports.useGetInvoiceForms = exports.useGetAllForms = exports.useGetBitacoraRechazoMasivo = exports.useGetCCPorcentajesDeRechazo = exports.useGetMotivosDeRechazo = exports.useGetTiposDeMuestra = exports.useGetInvoicesByCurrentAgency = exports.useGetInvoicesByLab = exports.useGetShipmentsToMyAgency = exports.useGetEmployees = exports.useGetEmployeesByCurrentAgency = exports.useGetEmployeesByLab = exports.useGetPaymentMethods = exports.useGetPaymentTerms = exports.useGetSuggestedPrices = exports.useGetAgencies = exports.useGetPrintTemplates = exports.useGetPayeesForLab = exports.useGetPayees = exports.useGetClientCategories = exports.useGetProviderCategories = exports.useGetMyCases = exports.useGetProviders = exports.useGetReceptionTypes = exports.useGetCurrencies = exports.useGetBundlesForLab = exports.useGetBundlesRecipForLab = exports.useGetPayeeCategoriesLabPrices = exports.useGetPayeeCategories = exports.useGetTemplates = exports.useGetBookings = exports.useGetItemCategoriesForLab = exports.useGetItemServicesByLab = exports.useGetMyAgencyLotStocks = exports.useGetItemsByLab = exports.useGetItemsByReception = exports.useGetItems = void 0;
|
|
4
4
|
exports.useGetReduxCatalog = useGetReduxCatalog;
|
|
5
5
|
const react_1 = require("@remix-run/react");
|
|
6
6
|
const react_2 = require("react");
|
|
@@ -70,7 +70,7 @@ function useGetReduxCatalog(CATALOG_NAME, { online = false, wheres = [], otherPa
|
|
|
70
70
|
if (hasLocalData) {
|
|
71
71
|
console.error("Hubo un error pero hay datos locales en la consulta de", CATALOG_NAME, " Error: ", error);
|
|
72
72
|
setData({
|
|
73
|
-
data:
|
|
73
|
+
data: catalogData?.data || [],
|
|
74
74
|
loading: false,
|
|
75
75
|
});
|
|
76
76
|
}
|
|
@@ -88,7 +88,7 @@ function useGetReduxCatalog(CATALOG_NAME, { online = false, wheres = [], otherPa
|
|
|
88
88
|
// Si no vamos a hacer fetch, asegurarnos de que loading esté en false
|
|
89
89
|
// y mantener lo que ya tengamos en Redux
|
|
90
90
|
setData({
|
|
91
|
-
data:
|
|
91
|
+
data: catalogData?.data || [],
|
|
92
92
|
loading: false,
|
|
93
93
|
});
|
|
94
94
|
}
|
|
@@ -268,6 +268,8 @@ const useGetTiposDeMuestra = (config) => useGetReduxCatalog("tiposDeMuestra", co
|
|
|
268
268
|
exports.useGetTiposDeMuestra = useGetTiposDeMuestra;
|
|
269
269
|
const useGetMotivosDeRechazo = (config) => useGetReduxCatalog("motivosRechazo", config);
|
|
270
270
|
exports.useGetMotivosDeRechazo = useGetMotivosDeRechazo;
|
|
271
|
+
const useGetCCPorcentajesDeRechazo = (config) => useGetReduxCatalog("ccPorcentajesDeRechazo", config);
|
|
272
|
+
exports.useGetCCPorcentajesDeRechazo = useGetCCPorcentajesDeRechazo;
|
|
271
273
|
const useGetBitacoraRechazoMasivo = (config) => useGetReduxCatalog("bitacoraRechazoMasivo", config);
|
|
272
274
|
exports.useGetBitacoraRechazoMasivo = useGetBitacoraRechazoMasivo;
|
|
273
275
|
const useGetAllForms = (config) => {
|
package/dist/esm/templates.js
CHANGED
|
@@ -27,7 +27,7 @@ function useGetTemplateObject(TEMPLATE_NAME, config = {}) {
|
|
|
27
27
|
* - En caso contrario, mostramos datos locales y no hacemos fetch.
|
|
28
28
|
*/
|
|
29
29
|
(0, react_2.useEffect)(() => {
|
|
30
|
-
const mustFetch = config.online || !hasLocalData;
|
|
30
|
+
const mustFetch = config.online || objectData?.reFetch || !hasLocalData;
|
|
31
31
|
if (mustFetch) {
|
|
32
32
|
setData((prev) => ({ ...prev, loading: true }));
|
|
33
33
|
dispatch((0, redux_1.templateFetchStart)(TEMPLATE_NAME));
|
|
@@ -59,7 +59,7 @@ function useGetTemplateObject(TEMPLATE_NAME, config = {}) {
|
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
62
|
-
}, [config.online, hasLocalData, TEMPLATE_NAME]);
|
|
62
|
+
}, [config.online, objectData?.reFetch, hasLocalData, TEMPLATE_NAME]);
|
|
63
63
|
/**
|
|
64
64
|
* 2) Efecto para cuando el fetcher termina (fetcher.state === "idle").
|
|
65
65
|
* Decidimos si lo que vino es error o data, y procedemos.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/hooks",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.153",
|
|
4
4
|
"description": "Hooks reutilizables dentro de las webapps de Zauru.",
|
|
5
5
|
"main": "./dist/esm/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@remix-run/react": "^2.8.1",
|
|
29
|
-
"@zauru-sdk/common": "^2.0.
|
|
29
|
+
"@zauru-sdk/common": "^2.0.152",
|
|
30
30
|
"@zauru-sdk/icons": "^2.0.99",
|
|
31
|
-
"@zauru-sdk/redux": "^2.0.
|
|
32
|
-
"@zauru-sdk/types": "^2.0.
|
|
31
|
+
"@zauru-sdk/redux": "^2.0.152",
|
|
32
|
+
"@zauru-sdk/types": "^2.0.152",
|
|
33
33
|
"react": "^18.2.0",
|
|
34
34
|
"react-dom": "^18.2.0"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "8a4cdbcaf7f52efce43b93ee01c82bce9e07f3ed"
|
|
37
37
|
}
|