
import useGetQueryPagination from "./helper/ueGetPagination";
import useAddMutation from "./helper/useAddMutation"
import useDeleteMutation from "./helper/useDeleteMutation"
import useGetSingleQuery from "./helper/useGetSingleQuery";
import useUpdateMutation from "./helper/useUpdateMutation";
import useUpdateMutationById from "./helper/useUpdateMutationById";
  
const API = {
  ADD: `attribute`,
  GET_ALL: `attribute`,

  DELETE: `attribute`,
  UPDATE: `attribute`,

};
const KEY = "ATTRIBUTE"
const KEYS =['ATTRIBUTE', 'CATEGORIES']

export const useGetAttribute = (params?:any) => useGetQueryPagination(KEYS, API.GET_ALL,params);
// export const useGetOneAttribute = (params?:any) => useGetOneQuery(KEY, API.GET_ALL,params);
export const useGetSingleAttribute = (params?:any,options?:any) => useGetSingleQuery(KEY, API.GET_ALL,params,options);

export const useAddAttribute = () => useAddMutation(KEY, API.ADD);

export const useUpdateAttribute = (method:any) => useUpdateMutationById(KEY, API.UPDATE,false,method);
export const useUpdateAttributeStatus = () => useUpdateMutation(KEY, API.UPDATE,false);

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