
import useGetQueryPagination from "./helper/ueGetPagination";
import useAddMutation from "./helper/useAddMutation"
import useDeleteMutation from "./helper/useDeleteMutation"
import useGetOneQuery from "./helper/useGetOneQuery";
import useUpdateMutation from "./helper/useUpdateMutation";
import useUpdateMutationById from "./helper/useUpdateMutationById";
  
const API = {
  ADD: `user`,
  // GET_ALL: `user?notOfType=admin`,
  GET_ALL: `user`,

  DELETE: `user`,
  UPDATE: `user/updateStatus`,
  UPDATE_ADMIN: `user/changeAdminPassword`,


};
const KEY = "User"


export const useGetUsers = (params?:any) => useGetQueryPagination(KEY, API.GET_ALL,params);
export const useGetOneUser = (params?:any) => useGetOneQuery(KEY, API.GET_ALL,params);

export const useAddUsers = () => useAddMutation(KEY, API.ADD);
export const useUpdateUsers = (method?:string) => useUpdateMutationById(KEY, API.UPDATE,true,method);
export const useUpdateAdmin = () => useAddMutation(KEY, API.UPDATE_ADMIN);

export const useDeleteUsers = () =>useDeleteMutation(KEY, API.DELETE);


