Skip to content

Commit

Permalink
Handle files in task drafts
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanpro committed Apr 25, 2024
1 parent 1bf9599 commit 2aa8ee4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/DataProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,18 @@ export default {

deleteFile(id, token = null) {
let url = `files/${id}`;
if (token) {
url += `?token=${token}`;

const queryParams = {
token
};

const taskId = get(window, '_current_task_id', 0);

if (taskId) {
queryParams.task_id = taskId;
}
return this.delete(url);

return this.delete(url, { params: queryParams });
},

download(url) {
Expand Down
1 change: 1 addition & 0 deletions src/components/renderer/file-upload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ export default {
data_name: this.name,
parent: null,
row_id: null,
task_id: _.get(window, '_current_task_id', 0),
},
testChunks: false,
// Setup our headers to deal with API calls
Expand Down

0 comments on commit 2aa8ee4

Please sign in to comment.