fix(z-task-modal): fixed error with ID on draft subtask update

This commit is contained in:
Matej Glasnák committed 2025-12-16 17:08:22 +01:00
1 parent 621be0641e
commit 1ec7f2555a
2 files changed
+4 -3

No files matched your search

+2 -2
View File
@@ -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,
);
}
@@ -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