mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-18 07:23:51 +01:00
Show gRPC requests in sidebar
This commit is contained in:
10
src-web/hooks/useUpdateHttpRequest.ts
Normal file
10
src-web/hooks/useUpdateHttpRequest.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { useMutation } from '@tanstack/react-query';
|
||||
import type { HttpRequest } from '../lib/models';
|
||||
import { useUpdateAnyHttpRequest } from './useUpdateAnyHttpRequest';
|
||||
|
||||
export function useUpdateHttpRequest(id: string | null) {
|
||||
const updateAnyRequest = useUpdateAnyHttpRequest();
|
||||
return useMutation<void, unknown, Partial<HttpRequest> | ((r: HttpRequest) => HttpRequest)>({
|
||||
mutationFn: async (update) => updateAnyRequest.mutateAsync({ id: id ?? 'n/a', update }),
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user