32 lines
1007 B
TypeScript
32 lines
1007 B
TypeScript
import useAddMutation from "./helper/useAddMutation";
|
|
import useDeleteMutation from "./helper/useDeleteMutation";
|
|
import useGetQuery from "./helper/useGetQuery";
|
|
import useUpdateMutation from "./helper/useUpdateMutation";
|
|
|
|
const API = {
|
|
GET: "/manager",
|
|
ADD: "/manager",
|
|
DELETE: "/manager",
|
|
UPDATE: "/manager",
|
|
MOVE: "/manager/moveManagers",
|
|
IMPORT: "/manager/importManagers",
|
|
};
|
|
|
|
const KEY = "manager";
|
|
|
|
export const useGetAllManager = (params?: any, options?: any) =>
|
|
useGetQuery(KEY, API.GET, params);
|
|
|
|
export const useGetManager = (params?: any, options?: any) =>
|
|
useGetQuery(KEY, API.GET, params, options);
|
|
|
|
export const useAddManager = () => useAddMutation(KEY, API.ADD);
|
|
export const useUpdateManager = (params?: any) =>
|
|
useUpdateMutation(KEY, API.GET);
|
|
|
|
export const useDeleteManager = (params?: any) =>
|
|
useDeleteMutation(KEY, API.DELETE);
|
|
|
|
export const useMoveManager = () => useAddMutation(KEY, API.MOVE);
|
|
export const useImportManager = () => useAddMutation(KEY, API.IMPORT);
|