Files
yaak/src-web/hooks/useDeleteResponse.ts
2023-03-20 16:47:36 -07:00

12 lines
301 B
TypeScript

import { useMutation } from '@tanstack/react-query';
import { invoke } from '@tauri-apps/api';
export function useDeleteResponse(id: string | null) {
return useMutation({
mutationFn: async () => {
if (id === null) return;
await invoke('delete_response', { id: id });
},
});
}