
import useGetQueryPagination from "./helper/ueGetPagination";
import useAddMutation from "./helper/useAddMutation"
import useDeleteMutation from "./helper/useDeleteMutation"
import useGetOneQuery from "./helper/useGetOneQuery";
import useGetQuery from "./helper/useGetQuery"
import useUpdateMutation from "./helper/useUpdateMutation";
import useUpdateMutationById from "./helper/useUpdateMutationById";
  
const API = {
  ADD: `baseProduct`,
  GET_ALL: `baseProduct`,
  DELETE: `baseProduct`,
  UPDATE: `baseProduct`,
  ADD_VAR:"product",
  UPDATE_VAR:"product",
  DELETE_VAR:"product"


};
const KEY = "Product"
// const ONEKEY = "Product"


export const useGetProduct = (params?:any) => useGetQueryPagination(KEY, API.GET_ALL,params,{},"category");
export const useGetOneProduct = (params?:any) => useGetOneQuery(KEY, API.GET_ALL,params);

export const useAddProduct = () => useAddMutation(KEY, API.ADD);
export const useAddProductVariation = () => useAddMutation(KEY, API.ADD_VAR);

export const useUpdateProduct = (method:any) => useUpdateMutation(KEY, API.UPDATE,true,method);
export const useUpdateProductVariation = (method?:any) => useUpdateMutationById(KEY, API.UPDATE_VAR,false,method);

export const useUpdateProductStatus = () => useUpdateMutation(KEY, API.UPDATE);

export const useDeleteProduct = () =>useDeleteMutation(KEY, API.DELETE);
export const useDeleteProductVariation = () =>useDeleteMutation(KEY, API.DELETE_VAR);

