mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-17 23:13:51 +01:00
Optimized a few components
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import { useMutation } from '@tanstack/react-query';
|
||||
import { invoke } from '@tauri-apps/api';
|
||||
import type { HttpRequest } from '../lib/models';
|
||||
import { useRequest } from './useRequest';
|
||||
|
||||
export function useUpdateRequest(request: HttpRequest | null) {
|
||||
export function useUpdateRequest(id: string | null) {
|
||||
const request = useRequest(id);
|
||||
return useMutation<void, unknown, Partial<HttpRequest>>({
|
||||
mutationFn: async (patch) => {
|
||||
if (request == null) {
|
||||
|
||||
Reference in New Issue
Block a user