Skip to content

Commit

Permalink
fix invariant exception (#6410)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackkav committed Aug 29, 2023
1 parent 98e292d commit a35e99b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/insomnia/src/ui/routes/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ export const reorderCollectionAction: ActionFunction = async ({ request, params
invariant(typeof id === 'string', 'ID is required');
invariant(typeof targetId === 'string', 'Target ID is required');
invariant(typeof dropPosition === 'string', 'Drop position is required');
invariant(metaSortKey, 'MetaSortKey position is required');
invariant(typeof metaSortKey === 'number', 'MetaSortKey position is required');

if (id === targetId) {
return null;
Expand Down
28 changes: 15 additions & 13 deletions packages/insomnia/src/ui/routes/debug.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -472,19 +472,21 @@ export const Debug: FC = () => {
}
}

reorderFetcher.submit(
{
targetId,
id,
dropPosition: event.target.dropPosition,
metaSortKey,
},
{
action: `/organization/${organizationId}/project/${projectId}/workspace/${workspaceId}/debug/reorder`,
method: 'POST',
encType: 'application/json',
}
);
if (metaSortKey) {
reorderFetcher.submit(
{
targetId,
id,
dropPosition: event.target.dropPosition,
metaSortKey,
},
{
action: `/organization/${organizationId}/project/${projectId}/workspace/${workspaceId}/debug/reorder`,
method: 'POST',
encType: 'application/json',
}
);
}
},
renderDropIndicator(target) {
return (
Expand Down

0 comments on commit a35e99b

Please sign in to comment.