mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-18 06:57:11 +01:00
15 lines
514 B
TypeScript
15 lines
514 B
TypeScript
import { useMutation } from '@tanstack/react-query';
|
|
import { trackEvent } from '../lib/analytics';
|
|
import { invokeCmd } from '../lib/tauri';
|
|
|
|
export function useDeleteGrpcConnections(requestId?: string) {
|
|
return useMutation({
|
|
mutationKey: ['delete_grpc_connections', requestId],
|
|
mutationFn: async () => {
|
|
if (requestId === undefined) return;
|
|
await invokeCmd('cmd_delete_all_grpc_connections', { requestId });
|
|
},
|
|
onSettled: () => trackEvent('grpc_connection', 'delete_many'),
|
|
});
|
|
}
|