From 153bd503e66ffe270182ada727380bbee6f9e03a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Glasn=C3=A1k?= Date: Tue, 16 Dec 2025 17:16:12 +0100 Subject: [PATCH] feat(z-task-modal): initialize empty subtask on create with current user --- app/src/plugins/tm@modal/task/z-task-modal.vue | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 6035fda..a409585 100644 --- a/app/src/plugins/tm@modal/task/z-task-modal.vue +++ b/app/src/plugins/tm@modal/task/z-task-modal.vue @@ -888,11 +888,24 @@ export default { throw new Error('subtaskData is null or undefined'); } } catch (error) { + // Initialize with current logged-in employee + const currentUserId = this.$store.getters['auth/user']?.id; + const currentEmployee = currentUserId + ? this.enrichedEmployees.find((emp) => emp.id === currentUserId) + : null; + this.subtask = { master_task: mastertask, - employees: [{}], + employees: currentEmployee + ? [{ id: currentEmployee.id, duration: null }] + : [{}], _deadline_time: '17:00', }; + + // Add a timeblock for the current user if they exist + if (currentUserId) { + this.addTimeblock(currentUserId); + } } if (