@erpp/react-api-cronos-frontend 1.0.7 → 1.0.10
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/index.d.mts +223 -212
- package/dist/index.d.ts +223 -212
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1303,6 +1303,7 @@ var APIClientBase = class {
|
|
|
1303
1303
|
return false;
|
|
1304
1304
|
}
|
|
1305
1305
|
}
|
|
1306
|
+
// async query({ params }: QueryParams<TQuery>): Promise<TResponse[] | null> {
|
|
1306
1307
|
async query({ params }) {
|
|
1307
1308
|
try {
|
|
1308
1309
|
const url = `${this.endpoint}`;
|
|
@@ -1393,7 +1394,7 @@ function createApiHooksBase(client) {
|
|
|
1393
1394
|
}, [JSON.stringify(params)]);
|
|
1394
1395
|
return { data, error, isFetching, isLoading, refetch: fetchData };
|
|
1395
1396
|
}
|
|
1396
|
-
function useFetchList(params) {
|
|
1397
|
+
function useFetchList(params, config) {
|
|
1397
1398
|
const [data, setData] = (0, import_react.useState)(null);
|
|
1398
1399
|
const [error, setError] = (0, import_react.useState)(null);
|
|
1399
1400
|
const [isFetching, setIsFetching] = (0, import_react.useState)(false);
|
|
@@ -1412,6 +1413,11 @@ function createApiHooksBase(client) {
|
|
|
1412
1413
|
setIsLoading(false);
|
|
1413
1414
|
}
|
|
1414
1415
|
}, [JSON.stringify(params)]);
|
|
1416
|
+
(0, import_react.useEffect)(function() {
|
|
1417
|
+
if ((config == null ? void 0 : config.fetchOnMount) === true) {
|
|
1418
|
+
fetchData();
|
|
1419
|
+
}
|
|
1420
|
+
}, [fetchData, config == null ? void 0 : config.fetchOnMount]);
|
|
1415
1421
|
return { data, error, isFetching, isLoading, refetch: fetchData };
|
|
1416
1422
|
}
|
|
1417
1423
|
function useCreate() {
|