Skip to content

Commit 36194eb

Browse files
authored
Merge pull request #45 from povio/fix/query-use-mutation
fix order of formdata
2 parents f19a118 + e9cfb0a commit 36194eb

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@povio/openapi-codegen-cli",
3-
"version": "1.2.10",
3+
"version": "1.2.11",
44
"main": "./dist/index.js",
55
"bin": {
66
"openapi-codegen": "./dist/sh.js"

src/generators/templates/partials/query-use-mutation.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ export const {{queryName endpoint mutation=true}} = (options?: AppMutationOption
1717
let dataToSend: File | FormData = file;
1818
if (method === "post") {
1919
dataToSend = new FormData();
20-
dataToSend.append('file', file);
2120
if (uploadInstructions.fields) {
2221
for (const [key, value] of uploadInstructions.fields) {
2322
dataToSend.append(key, value);
2423
}
2524
}
25+
dataToSend.append('file', file);
2626
}
2727
await axios[method](uploadInstructions.url, dataToSend, {
2828
headers: {

0 commit comments

Comments
 (0)