File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
templates/base/http-clients Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -106,8 +106,12 @@ export class HttpClient<SecurityDataType = unknown> {
106106 [ContentType.Json]: (input:any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,
107107 [ContentType.JsonApi]: (input:any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,
108108 [ContentType.Text]: (input:any) => input !== null && typeof input !== "string" ? JSON.stringify(input) : input,
109- [ContentType.FormData]: (input: any) =>
110- Object.keys(input || {}).reduce((formData, key) => {
109+ [ContentType.FormData]: (input: any) => {
110+ if (input instanceof FormData) {
111+ return input;
112+ }
113+
114+ return Object.keys(input || {}).reduce((formData, key) => {
111115 const property = input[key];
112116 formData.append(
113117 key,
@@ -118,7 +122,8 @@ export class HttpClient<SecurityDataType = unknown> {
118122 `${property}`
119123 );
120124 return formData;
121- }, new FormData()),
125+ }, new FormData());
126+ },
122127 [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input),
123128 }
124129
You can’t perform that action at this time.
0 commit comments