|
@@ -0,0 +1,11 @@
|
|
|
+import { useQuery } from '@tanstack/react-query';
|
|
|
+import { request } from '../../utils';
|
|
|
+import { API } from '../../types';
|
|
|
+
|
|
|
+export const apiCall = (key: API, data?: unknown, enabled?: boolean) => {
|
|
|
+ return useQuery({
|
|
|
+ enabled: false,
|
|
|
+ queryKey: [key],
|
|
|
+ queryFn: () => request.postForm(key, data ?? {})
|
|
|
+ });
|
|
|
+};
|