mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-15 16:23:25 +01:00
15 lines
511 B
TypeScript
15 lines
511 B
TypeScript
import { useMutation } from '@tanstack/react-query';
|
|
import type { HttpResponse } from '@yaakapp/api';
|
|
import { trackEvent } from '../lib/analytics';
|
|
import { invokeCmd } from '../lib/tauri';
|
|
|
|
export function useDeleteHttpResponse(id: string | null) {
|
|
return useMutation<HttpResponse>({
|
|
mutationKey: ['delete_http_response', id],
|
|
mutationFn: async () => {
|
|
return await invokeCmd('cmd_delete_http_response', { id: id });
|
|
},
|
|
onSettled: () => trackEvent('http_response', 'delete'),
|
|
});
|
|
}
|