mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-15 13:43:39 +01:00
12 lines
323 B
TypeScript
12 lines
323 B
TypeScript
import { useMutation } from '@tanstack/react-query';
|
|
import { invoke } from '@tauri-apps/api';
|
|
|
|
export function useSendRequest(id: string | null) {
|
|
return useMutation<void, string>({
|
|
mutationFn: async () => {
|
|
if (id === null) return;
|
|
await invoke('send_request', { requestId: id });
|
|
},
|
|
}).mutate;
|
|
}
|