Skip to content

Commit

Permalink
fix(upload-file): add body to api
Browse files Browse the repository at this point in the history
  • Loading branch information
ngyngcphu committed Nov 17, 2023
1 parent 5cf1391 commit 3d6736d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"postcss": "^8.4.27",
"prettier": "3.0.1",
"tailwindcss": "^3.3.3",
"typescript": "^5.0.2",
"typescript": "^5.2.2",
"vite": "^4.4.5",
"vite-tsconfig-paths": "^4.2.1"
}
Expand Down
9 changes: 8 additions & 1 deletion src/openapi-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,14 @@ export interface paths {
};
cookie?: never;
};
requestBody?: never;
requestBody: {
content: {
'multipart/form-data': {
/** Format: binary */
file: string;
};
};
};
responses: {
/** @description Default Response */
200: {
Expand Down
3 changes: 3 additions & 0 deletions src/services/printingRequest.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ export const printingRequestService = {
invoke(
apiClient.POST('/api/printRequest/{printingRequestId}/upload-file', {
params: { path: { printingRequestId } },
body: {
file: ''
},
bodySerializer: () => {
const formData = new FormData();
formData.append('file', file);
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4845,7 +4845,7 @@ type-fest@^2.19.0:
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.19.0.tgz#88068015bb33036a598b952e55e9311a60fd3a9b"
integrity sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==

"typescript@^4.6.4 || ^5.0.0", typescript@^5.0.2, typescript@^5.2.2:
"typescript@^4.6.4 || ^5.0.0", typescript@^5.2.2:
version "5.2.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78"
integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==
Expand Down

0 comments on commit 3d6736d

Please sign in to comment.