fix multiple file upload (#2735)

for typescript-angular client
https://swagger.io/docs/specification/describing-request-body/file-upload/
This commit is contained in:
topce
2019-05-06 16:03:11 +02:00
committed by William Cheng
parent e34e85427b
commit 632364e290

View File

@@ -300,7 +300,13 @@ export class {{classname}} {
})
{{/isCollectionFormatMulti}}
{{^isCollectionFormatMulti}}
{{#useHttpClient}}formParams = {{/useHttpClient}}formParams.append('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}'])){{#useHttpClient}} as any || formParams{{/useHttpClient}};
if (useForm) {
{{paramName}}.forEach((element) => {
{{#useHttpClient}}formParams = {{/useHttpClient}}formParams.append('{{baseName}}', <any>element){{#useHttpClient}} as any || formParams{{/useHttpClient}};
})
} else {
{{#useHttpClient}}formParams = {{/useHttpClient}}formParams.append('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}'])){{#useHttpClient}} as any || formParams{{/useHttpClient}};
}
{{/isCollectionFormatMulti}}
}
{{/isListContainer}}