From 37f4f3ab9638101009b2d1798ae2c71e945ea1c9 Mon Sep 17 00:00:00 2001 From: dolevl Date: Mon, 29 Jan 2024 10:37:03 +0200 Subject: [PATCH] Checking if instanceof FormData before creating one. --- templates/base/http-clients/axios-http-client.ejs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/base/http-clients/axios-http-client.ejs b/templates/base/http-clients/axios-http-client.ejs index d0acff01..f05e7de1 100644 --- a/templates/base/http-clients/axios-http-client.ejs +++ b/templates/base/http-clients/axios-http-client.ejs @@ -79,6 +79,9 @@ export class HttpClient { } protected createFormData(input: Record): FormData { + if (input instanceof FormData) { + return input; + } return Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; const propertyContent: any[] = (property instanceof Array) ? property : [property]