From e4c37b916a704cc6bbb142c6b7f986e0163cec36 Mon Sep 17 00:00:00 2001 From: Pragadesh-45 Date: Wed, 19 Mar 2025 16:11:51 +0530 Subject: [PATCH] feat: set default names for folders and requests in Postman collection importer --- .../bruno-app/src/utils/importers/postman-collection.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/bruno-app/src/utils/importers/postman-collection.js b/packages/bruno-app/src/utils/importers/postman-collection.js index 4c90a9203..49c3dbece 100644 --- a/packages/bruno-app/src/utils/importers/postman-collection.js +++ b/packages/bruno-app/src/utils/importers/postman-collection.js @@ -185,7 +185,7 @@ const importPostmanV2CollectionItem = (brunoParent, item, parentAuth, options) = each(item, (i) => { if (isItemAFolder(i)) { - const baseFolderName = i.name; + const baseFolderName = i.name || 'Untitled Folder'; let folderName = baseFolderName; let count = 1; @@ -236,7 +236,7 @@ const importPostmanV2CollectionItem = (brunoParent, item, parentAuth, options) = return; } - const baseRequestName = i.name; + const baseRequestName = i.name || 'Untitled Request'; let requestName = baseRequestName; let count = 1; @@ -545,7 +545,7 @@ const searchLanguageByHeader = (headers) => { const importPostmanV2Collection = (collection, options) => { const brunoCollection = { - name: collection.info.name, + name: collection.info.name || 'New Collection', uid: uuid(), version: '1', items: [], @@ -553,7 +553,7 @@ const importPostmanV2Collection = (collection, options) => { root: { docs: collection.info.description || '', meta: { - name: collection.info.name + name: collection.info.name || 'New Collection' }, request: { auth: {