From cc9e8c4f1efe58d3a00f51559b80958f3b67bb20 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Sun, 2 Jun 2024 11:53:25 -0700 Subject: [PATCH] Import content-type from Postman multi-part form --- plugins/importer-postman/src/index.ts | 2 ++ src-tauri/plugins/importer-postman/index.mjs | 1 + 2 files changed, 3 insertions(+) diff --git a/plugins/importer-postman/src/index.ts b/plugins/importer-postman/src/index.ts index 43af714c..b0ddbffa 100644 --- a/plugins/importer-postman/src/index.ts +++ b/plugins/importer-postman/src/index.ts @@ -180,6 +180,7 @@ function importBody(rawBody: any): Pick(obj: T): T { } const idCount: Partial> = {}; + function generateId(model: Model['model']): string { idCount[model] = (idCount[model] ?? -1) + 1; return `GENERATE_ID::${model.toUpperCase()}_${idCount[model]}`; diff --git a/src-tauri/plugins/importer-postman/index.mjs b/src-tauri/plugins/importer-postman/index.mjs index fd6d58c9..0e813e99 100644 --- a/src-tauri/plugins/importer-postman/index.mjs +++ b/src-tauri/plugins/importer-postman/index.mjs @@ -131,6 +131,7 @@ function j(e) { form: b(t.formdata).map( (n) => n.src != null ? { enabled: !n.disabled, + contentType: n.contentType ?? null, name: n.key ?? "", file: n.src ?? "" } : {