Skip to content

Commit

Permalink
fix Kong#5942: Retain exported ID for resource
Browse files Browse the repository at this point in the history
  • Loading branch information
adammkelly committed May 19, 2023
1 parent 7ad9e24 commit 27c14c6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/insomnia/src/common/import.ts
Expand Up @@ -276,7 +276,12 @@ export async function importResources({
for (const resource of resourcesWithoutWorkspaceAndApiSpec) {
const model = getModel(resource.type);
if (model) {
ResourceIdMap.set(resource._id, generateId(model.prefix));
if (!resource._id) {
ResourceIdMap.set(resource._id, generateId(model.prefix));
} else {
console.log('[Import Scan] Retaining ID: ', resource._id);
ResourceIdMap.set(resource._id, resource._id);
}
} else {
console.log(
'[Import Scan] Could not find model for type',
Expand Down

0 comments on commit 27c14c6

Please sign in to comment.