mirror of
https://github.com/Kong/insomnia.git
synced 2026-04-22 07:08:16 -04:00
fix invariant exception (#6410)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user