import { useMutation } from '@tanstack/react-query'; import { useChainService } from '../../../stores'; interface UseDeleteRefVdtOpts { onSuccess?: () => void; } export function useDeleteRefVdt(opts: UseDeleteRefVdtOpts) { const chainService = useChainService(); const { mutate: deleteRefVdt, isPending: isDeletingRefVdt } = useMutation({ mutationKey: ['delete-reference-vdt'], mutationFn: (req: { id: string; qrCodeRefId: string }) => chainService.deleteReferenceVdt(req.id, req.qrCodeRefId), onSuccess: opts?.onSuccess, }); return { deleteRefVdt, isDeletingRefVdt }; }