Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
gschier committed Nov 16, 2024
1 parent 23c0261 commit 3ecfb15
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src-web/hooks/useImportCurl.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useMutation } from '@tanstack/react-query';
import type { HttpRequest } from '@yaakapp-internal/models';
import { useToast } from '../components/ToastContext';
import { invokeCmd } from '../lib/tauri';
import { useActiveWorkspace } from './useActiveWorkspace';
import { useCreateHttpRequest } from './useCreateHttpRequest';
import { useRequestUpdateKey } from './useRequestUpdateKey';
import { useUpdateAnyHttpRequest } from './useUpdateAnyHttpRequest';
import type { HttpRequest } from '@yaakapp-internal/models';

export function useImportCurl() {
const workspace = useActiveWorkspace();
Expand Down Expand Up @@ -34,17 +34,19 @@ export function useImportCurl() {
await createRequest.mutateAsync(request);
} else {
verb = 'Updated';
let update = (r: HttpRequest) => ({
...r,
...request,
id: r.id,
createdAt: r.createdAt,
workspaceId: r.workspaceId,
folderId: r.folderId,
name: r.name,
sortPriority: r.sortPriority,
await updateRequest.mutateAsync({
id: overwriteRequestId,
update: (r: HttpRequest) => ({
...request,
id: r.id,
createdAt: r.createdAt,
workspaceId: r.workspaceId,
folderId: r.folderId,
name: r.name,
sortPriority: r.sortPriority,
}),
});
await updateRequest.mutateAsync({ id: overwriteRequestId, update: update });

setTimeout(() => wasUpdatedExternally(overwriteRequestId), 100);
}

Expand Down

0 comments on commit 3ecfb15

Please sign in to comment.