From 1ec7f2555a0631b9c7db10496cec23e056fdb26b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Glasn=C3=A1k?= Date: Tue, 16 Dec 2025 17:08:22 +0100 Subject: [PATCH] fix(z-task-modal): fixed error with ID on draft subtask update --- app/src/plugins/tm@_store/store/index.ts | 4 ++-- app/src/plugins/tm@modal/task/z-task-modal.vue | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/plugins/tm@_store/store/index.ts b/app/src/plugins/tm@_store/store/index.ts index 93a6389..e5b9659 100644 --- a/app/src/plugins/tm@_store/store/index.ts +++ b/app/src/plugins/tm@_store/store/index.ts @@ -72,12 +72,12 @@ export default { update_subtask(state: any, subtask: any) { if (state.unscheduledSubtasks) { state.unscheduledSubtasks = state.unscheduledSubtasks.map((st) => - st.id == subtask.id ? subtask : st, + st?.id == subtask?.id ? subtask : st, ); } if (state.ongoingSubtasks) { state.ongoingSubtasks = state.ongoingSubtasks.map((st) => - st.id == subtask.id ? subtask : st, + st?.id == subtask?.id ? subtask : st, ); } diff --git a/app/src/plugins/tm@modal/task/z-task-modal.vue b/app/src/plugins/tm@modal/task/z-task-modal.vue index 9d1b37f..6035fda 100644 --- a/app/src/plugins/tm@modal/task/z-task-modal.vue +++ b/app/src/plugins/tm@modal/task/z-task-modal.vue @@ -1104,6 +1104,7 @@ export default { } this.closeModal(); } catch (error) { + console.log('error', error); this.$toast.error(this.$parseError(error)); } finally { this.isSaving = false; @@ -1154,7 +1155,7 @@ export default { }, async _validateEmployees() { - if (this.subtask.id) { + if (this.subtask.id && !this.subtask.is_draft) { // For existing subtasks, at least one employee is required const hasEmployee = !!( this.subtask.employee_id && this.subtask.duration