feat(z-task-modal): initialize empty subtask on create with current user

This commit is contained in:
Matej Glasnák committed 2025-12-16 17:16:12 +01:00
1 parent 1ec7f2555a
commit 153bd503e6
1 file changed
+14 -1
+14 -1
View File
@@ -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 (