Skip to content

Commit

Permalink
fix(FileSystem): folder upload
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
  • Loading branch information
pedrolamas committed Jan 30, 2024
1 parent 447a340 commit 9d85b71
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/api/httpClientActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,15 @@ export const httpClientActions = {
},

serverFilesUploadPost (file: File, path: string, root: string, print?: boolean, options?: AxiosRequestConfig) {
const formData = new FormData()

formData.append('file', file, file.name)
formData.append('path', path)
formData.append('root', root)
if (print) {
formData.append('print', 'true')
}

return this.postForm<{
result: {
item: {
Expand All @@ -180,12 +189,7 @@ export const httpClientActions = {
print_started?: boolean,
action: string
}
}>('/server/files/upload', {
file,
path,
root,
print
}, options)
}>('/server/files/upload', formData, options)
},

serverFilesGet<T = unknown> (filepath: string, options?: AxiosRequestConfig) {
Expand Down

0 comments on commit 9d85b71

Please sign in to comment.