import { createTransferTeam, deleteTransferTeam, getAllTransferTeam, getAllTransferTeamAllMembers, getSingleTransferTeam, updateTransferTeam } from "@/service/apis/transfer-team";
import { useMutation, useQuery } from "@tanstack/react-query";

export const useGetAllTransferTeam = () => useQuery({
    queryKey:['get-all-transfer-team'],
    queryFn:getAllTransferTeam,
    retry:false,
    refetchOnWindowFocus:false
})
export const useGetAllTransferTeamAllMembers = () => useQuery({
    queryKey:['get-all-transfer-team-all-members'],
    queryFn:getAllTransferTeamAllMembers,
    retry:false,
    refetchOnWindowFocus:false
})
export const useGetSingleTransferTeam = (id:string) => useQuery({
    queryKey:['get-single-transfer-team',id],
    queryFn:()=>getSingleTransferTeam(id),
    retry:false,
    refetchOnWindowFocus:false
})

export const useCreateTransferTeam = ()=>useMutation({mutationFn:createTransferTeam})
export const useDeleteTransferTeam = ()=>useMutation({mutationFn:deleteTransferTeam})
export const useUpdateTransferTeam = ()=>useMutation({mutationFn:updateTransferTeam})