@zauru-sdk/hooks 2.0.176 → 2.0.178
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 +4 -0
- package/dist/esm/catalogs.js +25 -1
- package/package.json +5 -5
package/dist/catalogs.d.ts
CHANGED
|
@@ -183,6 +183,10 @@ export declare const useGetMyCaseFormSubmissions: (config?: ReduxParamsConfig) =
|
|
|
183
183
|
loading: boolean;
|
|
184
184
|
data: SubmissionCasesGraphQL[];
|
|
185
185
|
};
|
|
186
|
+
export declare const useGetCaseFormSubmissionsByCaseId: (config?: ReduxParamsConfig) => {
|
|
187
|
+
loading: boolean;
|
|
188
|
+
data: SubmissionCasesGraphQL[];
|
|
189
|
+
};
|
|
186
190
|
export declare const useGetInvoiceFormSubmissionsByInvoiceId: (config?: ReduxParamsConfig) => {
|
|
187
191
|
loading: boolean;
|
|
188
192
|
data: SubmissionInvoicesGraphQL[];
|
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.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;
|
|
3
|
+
exports.useGetInvoiceFormSubmissionsByInvoiceId = exports.useGetCaseFormSubmissionsByCaseId = 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");
|
|
@@ -362,6 +362,30 @@ const useGetMyCaseFormSubmissions = (config) => {
|
|
|
362
362
|
};
|
|
363
363
|
};
|
|
364
364
|
exports.useGetMyCaseFormSubmissions = useGetMyCaseFormSubmissions;
|
|
365
|
+
const useGetCaseFormSubmissionsByCaseId = (config) => {
|
|
366
|
+
const caseId = config?.otherParams?.caseId;
|
|
367
|
+
const withFiles = config?.otherParams?.withFiles;
|
|
368
|
+
const data = useGetReduxCatalog("caseFormSubmissionsByCaseId", {
|
|
369
|
+
otherParams: {
|
|
370
|
+
caseId: `${caseId}`,
|
|
371
|
+
withFiles: `${withFiles}`,
|
|
372
|
+
},
|
|
373
|
+
});
|
|
374
|
+
// Filtrar los registros para obtener sólo los de la versión más alta.
|
|
375
|
+
const groupedByVersion = (data.data || []).reduce((acc, record) => {
|
|
376
|
+
const zid = record.settings_form_submission.zid;
|
|
377
|
+
if (!acc[zid]) {
|
|
378
|
+
acc[zid] = record;
|
|
379
|
+
}
|
|
380
|
+
return acc;
|
|
381
|
+
}, {});
|
|
382
|
+
const latestVersionRecords = Object.values(groupedByVersion);
|
|
383
|
+
return {
|
|
384
|
+
loading: data.loading,
|
|
385
|
+
data: latestVersionRecords,
|
|
386
|
+
};
|
|
387
|
+
};
|
|
388
|
+
exports.useGetCaseFormSubmissionsByCaseId = useGetCaseFormSubmissionsByCaseId;
|
|
365
389
|
const useGetInvoiceFormSubmissionsByInvoiceId = (config) => {
|
|
366
390
|
const invoiceId = config?.otherParams?.invoiceId;
|
|
367
391
|
const withFiles = config?.otherParams?.withFiles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/hooks",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.178",
|
|
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.177",
|
|
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.178",
|
|
32
|
+
"@zauru-sdk/types": "^2.0.177",
|
|
33
33
|
"react": "^18.2.0",
|
|
34
34
|
"react-dom": "^18.2.0"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "de1597493fe293d152d099f9e687208df163c938"
|
|
37
37
|
}
|