Fixed asset:// loading and tweak curl stuff

This commit is contained in:
Gregory Schier
2024-05-13 23:20:30 -07:00
parent ad796275b6
commit 4a70c5415b
11 changed files with 91 additions and 129 deletions

View File

@@ -13,13 +13,7 @@ export function useCreateHttpRequest() {
const activeRequest = useActiveRequest();
const routes = useAppRoutes();
return useMutation<
HttpRequest,
unknown,
Partial<
Pick<HttpRequest, 'name' | 'sortPriority' | 'folderId' | 'bodyType' | 'method' | 'headers'>
>
>({
return useMutation<HttpRequest, unknown, Partial<HttpRequest>>({
mutationFn: (patch) => {
if (workspaceId === null) {
throw new Error("Cannot create request when there's no active workspace");
@@ -34,7 +28,8 @@ export function useCreateHttpRequest() {
}
}
patch.folderId = patch.folderId || activeRequest?.folderId;
return invoke('cmd_create_http_request', { workspaceId, name: '', ...patch });
console.log('PATCH', patch);
return invoke('cmd_create_http_request', { request: { workspaceId, ...patch } });
},
onSettled: () => trackEvent('http_request', 'create'),
onSuccess: async (request) => {