mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-16 14:06:49 +01:00
16 lines
493 B
TypeScript
16 lines
493 B
TypeScript
import { useMutation } from '@tanstack/react-query';
|
|
import { trackEvent } from '../lib/analytics';
|
|
import { useSendAnyRequest } from './useSendAnyRequest';
|
|
|
|
export function useSendManyRequests() {
|
|
const sendAnyRequest = useSendAnyRequest();
|
|
return useMutation<void, string, string[]>({
|
|
mutationFn: async (requestIds: string[]) => {
|
|
for (const id of requestIds) {
|
|
sendAnyRequest.mutate(id);
|
|
}
|
|
},
|
|
onSettled: () => trackEvent('http_request', 'send'),
|
|
});
|
|
}
|