@lasterp/shared 1.0.0-beta.15 → 1.0.0-beta.16
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.cjs +9 -6
- package/dist/index.js +9 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -235,12 +235,15 @@ var useFrappeGetCall = (method, params, options, type = "GET") => {
|
|
|
235
235
|
const queryKey = ["frappeCall", type, method, url];
|
|
236
236
|
const { data, error, isLoading, isFetching, refetch } = import_react_query2.useQuery({
|
|
237
237
|
queryKey,
|
|
238
|
-
queryFn:
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
238
|
+
queryFn: async () => {
|
|
239
|
+
if (type === "GET") {
|
|
240
|
+
const response = await call.get(method, params);
|
|
241
|
+
console.log("Response", response);
|
|
242
|
+
return response.message;
|
|
243
|
+
} else {
|
|
244
|
+
const response = await call.post(method, params);
|
|
245
|
+
return response.message;
|
|
246
|
+
}
|
|
244
247
|
},
|
|
245
248
|
enabled: (options?.enabled ?? true) && !!method,
|
|
246
249
|
staleTime: options?.staleTime,
|
package/dist/index.js
CHANGED
|
@@ -161,12 +161,15 @@ var useFrappeGetCall = (method, params, options, type = "GET") => {
|
|
|
161
161
|
const queryKey = ["frappeCall", type, method, url];
|
|
162
162
|
const { data, error, isLoading, isFetching, refetch } = useQuery2({
|
|
163
163
|
queryKey,
|
|
164
|
-
queryFn:
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
164
|
+
queryFn: async () => {
|
|
165
|
+
if (type === "GET") {
|
|
166
|
+
const response = await call.get(method, params);
|
|
167
|
+
console.log("Response", response);
|
|
168
|
+
return response.message;
|
|
169
|
+
} else {
|
|
170
|
+
const response = await call.post(method, params);
|
|
171
|
+
return response.message;
|
|
172
|
+
}
|
|
170
173
|
},
|
|
171
174
|
enabled: (options?.enabled ?? true) && !!method,
|
|
172
175
|
staleTime: options?.staleTime,
|