mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 06:20:21 +00:00
feat(z-task-modal): initialize empty subtask on create with current user
This commit is contained in:
1 parent
1ec7f2555a
commit
153bd503e6
1 file changed
+14
-1
@@ -888,11 +888,24 @@ export default {
|
|||||||
throw new Error('subtaskData is null or undefined');
|
throw new Error('subtaskData is null or undefined');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} 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 = {
|
this.subtask = {
|
||||||
master_task: mastertask,
|
master_task: mastertask,
|
||||||
employees: [{}],
|
employees: currentEmployee
|
||||||
|
? [{ id: currentEmployee.id, duration: null }]
|
||||||
|
: [{}],
|
||||||
_deadline_time: '17:00',
|
_deadline_time: '17:00',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Add a timeblock for the current user if they exist
|
||||||
|
if (currentUserId) {
|
||||||
|
this.addTimeblock(currentUserId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|||||||
Reference in new issue
Block a user