mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-15 21:53:36 +01:00
15 lines
506 B
TypeScript
15 lines
506 B
TypeScript
import { useMutation } from '@tanstack/react-query';
|
|
import { trackEvent } from '../lib/analytics';
|
|
import { invokeCmd } from '../lib/tauri';
|
|
|
|
export function useDeleteHttpResponses(requestId?: string) {
|
|
return useMutation({
|
|
mutationKey: ['delete_http_responses', requestId],
|
|
mutationFn: async () => {
|
|
if (requestId === undefined) return;
|
|
await invokeCmd('cmd_delete_all_http_responses', { requestId });
|
|
},
|
|
onSettled: () => trackEvent('http_response', 'delete_many'),
|
|
});
|
|
}
|