Hot keys and cleanup

This commit is contained in:
Gregory Schier
2023-04-03 07:59:49 -07:00
parent 529550934b
commit 62f3198d27
11 changed files with 149 additions and 129 deletions

View File

@@ -16,8 +16,9 @@ export function useCreateRequest({ navigateAfter }: { navigateAfter: boolean })
if (workspaceId === null) {
throw new Error("Cannot create request when there's no active workspace");
}
const sortPriority = maxSortPriority(requests) + 1000;
return invoke('create_request', { sortPriority, workspaceId, ...patch });
patch.name = patch.name || 'New Request';
patch.sortPriority = patch.sortPriority || maxSortPriority(requests) + 1000;
return invoke('create_request', { workspaceId, ...patch });
},
onSuccess: async (request) => {
queryClient.setQueryData<HttpRequest[]>(