From acb7f2e49bd896412835e888be81a0a6bfdffc2d Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Fri, 22 Mar 2024 10:40:51 -0700 Subject: [PATCH] Fix Postman variable import --- plugins/importer-postman/src/index.ts | 9 +++++---- src-tauri/plugins/importer-postman/index.mjs | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/importer-postman/src/index.ts b/plugins/importer-postman/src/index.ts index ead80898..050f7fbc 100644 --- a/plugins/importer-postman/src/index.ts +++ b/plugins/importer-postman/src/index.ts @@ -37,10 +37,11 @@ export function pluginHookImport(contents: string): { resources: ExportResources id: generateId('wk'), name: info.name || 'Postman Import', description: info.description || '', - variables: root.variable?.map((v: any) => ({ - name: v.key, - value: v.value, - })), + variables: + root.variable?.map((v: any) => ({ + name: v.key, + value: v.value, + })) ?? [], }; exportResources.workspaces.push(workspace); diff --git a/src-tauri/plugins/importer-postman/index.mjs b/src-tauri/plugins/importer-postman/index.mjs index da81b33c..a9b91f87 100644 --- a/src-tauri/plugins/importer-postman/index.mjs +++ b/src-tauri/plugins/importer-postman/index.mjs @@ -17,10 +17,10 @@ function v(t) { id: m("wk"), name: n.name || "Postman Import", description: n.description || "", - variables: (b = e.variable) == null ? void 0 : b.map((r) => ({ + variables: ((b = e.variable) == null ? void 0 : b.map((r) => ({ name: r.key, value: r.value - })) + }))) ?? [] }; i.workspaces.push(c); const f = (r, u = null) => {