This commit is contained in:
romankko2 committed 2023-09-18 12:22:24 +02:00
1 parent 4ed354904c
commit b16ff2e34f
4 files changed
+63 -95

No files matched your search

@@ -184,29 +184,30 @@ export default {
const end = date.setHours(Math.round(event.endTimeMinutes / 60), Math.round(event.endTimeMinutes % 60), 0)
const split = this.splits.find(split => split.id == newSplit )
if(this.$route.name == 'Dashboard - Tasks') {
const editedSubtask = {
...event.subtask,
timeblocks: [...event.subtask.timeblocks, {
id: event._timeblock_id,
is_finished: 0,
start: tmUtils.formatDateTimeForBackend(start),
end: tmUtils.formatDateTimeForBackend(end)
}],
timesheets: event.subtask.timesheets.map((timesheet) => {
delete timesheet.employee_name
return timesheet
})
}
try {
const { subtask } = await this.$axios.put_auth(`v1/subtasks/${editedSubtask.id}`, editedSubtask)
this.$events.emit('on-subtask-edited', subtask)
...event.subtask,
timeblocks: [...event.subtask.timeblocks, {
id: event._timeblock_id,
is_finished: 0,
start: tmUtils.formatDateTimeForBackend(start),
end: tmUtils.formatDateTimeForBackend(end)
}],
timesheets: event.subtask.timesheets.map((timesheet) => {
delete timesheet.employee_name
return timesheet
})
}
try {
const { subtask } = await this.$axios.put_auth(`v1/subtasks/${editedSubtask.id}`, editedSubtask)
this.$events.emit('on-subtask-edited', subtask)
if (subtask.employee_id == this.$store.getters['auth/user'].id)
this.$events.emit('show-task-add-time-modal', { subtask })
} catch (error) {
this.$toast.error(error.message || error)
}
if (subtask.employee_id == this.$store.getters['auth/user'].id)
this.$events.emit('show-task-add-time-modal', { subtask })
} catch (error) {
this.$toast.error(error.message || error)
}
} else if(this.$route.name == 'Dashboard - Teams') {
const editedSubtask = {
...event.subtask,