From 6a58a69031f8422efd4ccdc5377fb2f689f776aa Mon Sep 17 00:00:00 2001 From: ayntee Date: Thu, 28 Jan 2021 20:05:12 +0400 Subject: [PATCH 1/2] fix(models/rest): unique key for form data item --- src/models/rest.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/models/rest.ts b/src/models/rest.ts index f14e81d..7adbdf6 100644 --- a/src/models/rest.ts +++ b/src/models/rest.ts @@ -319,9 +319,7 @@ export class RESTManager { } } const form = new FormData() - for (const file of files) { - form.append(file.name, file.blob, file.name) - } + files.map((file, index) => form.append(`file${index + 1}`, file.blob, file.name)) const json = JSON.stringify(body) form.append('payload_json', json) if (body === undefined) body = {} From d7647a88eed4ed5e0aa72976a893d872b44e72b4 Mon Sep 17 00:00:00 2001 From: ayntee Date: Thu, 28 Jan 2021 20:26:41 +0400 Subject: [PATCH 2/2] Update src/models/rest.ts --- src/models/rest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/rest.ts b/src/models/rest.ts index 7adbdf6..daab5d1 100644 --- a/src/models/rest.ts +++ b/src/models/rest.ts @@ -319,7 +319,7 @@ export class RESTManager { } } const form = new FormData() - files.map((file, index) => form.append(`file${index + 1}`, file.blob, file.name)) + files.forEach((file, index) => form.append(`file${index + 1}`, file.blob, file.name)) const json = JSON.stringify(body) form.append('payload_json', json) if (body === undefined) body = {}