@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.mjs
CHANGED
|
@@ -800,6 +800,7 @@ var APIClientBase = class {
|
|
|
800
800
|
return false;
|
|
801
801
|
}
|
|
802
802
|
}
|
|
803
|
+
// async query({ params }: QueryParams<TQuery>): Promise<TResponse[] | null> {
|
|
803
804
|
async query({ params }) {
|
|
804
805
|
try {
|
|
805
806
|
const url = `${this.endpoint}`;
|
|
@@ -834,7 +835,7 @@ var AdeudoAPI = class extends APIClientBase {
|
|
|
834
835
|
var AdeudoAPI_default = AdeudoAPI;
|
|
835
836
|
|
|
836
837
|
// src/infrastructure/api/utils/createApiHooks.ts
|
|
837
|
-
import { useState, useCallback } from "react";
|
|
838
|
+
import { useState, useCallback, useEffect } from "react";
|
|
838
839
|
|
|
839
840
|
// src/infrastructure/api/utils/globalErrorLogger.ts
|
|
840
841
|
import fs from "fs";
|
|
@@ -890,7 +891,7 @@ function createApiHooksBase(client) {
|
|
|
890
891
|
}, [JSON.stringify(params)]);
|
|
891
892
|
return { data, error, isFetching, isLoading, refetch: fetchData };
|
|
892
893
|
}
|
|
893
|
-
function useFetchList(params) {
|
|
894
|
+
function useFetchList(params, config) {
|
|
894
895
|
const [data, setData] = useState(null);
|
|
895
896
|
const [error, setError] = useState(null);
|
|
896
897
|
const [isFetching, setIsFetching] = useState(false);
|
|
@@ -909,6 +910,11 @@ function createApiHooksBase(client) {
|
|
|
909
910
|
setIsLoading(false);
|
|
910
911
|
}
|
|
911
912
|
}, [JSON.stringify(params)]);
|
|
913
|
+
useEffect(function() {
|
|
914
|
+
if ((config == null ? void 0 : config.fetchOnMount) === true) {
|
|
915
|
+
fetchData();
|
|
916
|
+
}
|
|
917
|
+
}, [fetchData, config == null ? void 0 : config.fetchOnMount]);
|
|
912
918
|
return { data, error, isFetching, isLoading, refetch: fetchData };
|
|
913
919
|
}
|
|
914
920
|
function useCreate() {
|