@zauru-sdk/hooks 2.0.151 → 2.0.152
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/esm/catalogs.js +2 -2
- package/dist/esm/templates.js +2 -2
- package/package.json +5 -5
package/dist/esm/catalogs.js
CHANGED
|
@@ -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
|
}
|
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.152",
|
|
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": "355e7ea7662f3e2e848832e177f9d2ae680a6ba2"
|
|
37
37
|
}
|