[subtask] fileUpload - Update

This commit is contained in:
romankko2 committed 2024-02-22 18:46:38 +01:00
1 parent 8e1072a1d8
commit 4e9700069a
2 files changed
+3 -4

No files matched your search

@@ -319,8 +319,7 @@ export default {
return timesheet
})
// const { subtask } = await this.$axios.patch_auth_form(`v1/subtasks/${this.subtask.id}`, { ...this.subtask, timesheets })
const { subtask } = await this.$axios.put_auth(`v1/subtasks/${this.subtask.id}`, { ...this.subtask, timesheets })
const { subtask } = await this.$axios.patch_auth_form(`v1/subtasks/${this.subtask.id}`, { ...this.subtask, timesheets })
this.$store.commit('tm/update_subtask', subtask)
this.$events.emit('on-subtask-edited', this.subtask)
@@ -329,7 +328,7 @@ export default {
if (employee.id)
employee.timeblocks = this.timeblocks.filter(timeblock => timeblock.date).map(timeblock => { return { start: `${moment(timeblock.date).format('YYYY-MM-DD')} ${timeblock.starts_at_time}:00`, end: `${moment(timeblock.date).format('YYYY-MM-DD')} ${timeblock.ends_at_time}:00`, id: null } })
})
const subtaskCopy = JSON.parse(JSON.stringify(this.subtask))
const subtaskCopy = this.subtask
delete subtaskCopy._master_task
const { subtasks } = await this.$axios.post_auth(`v1/mastertasks/${this.subtask.master_task_id}/subtasks`, subtaskCopy)
this.subtask.id = subtasks[0].id