diff --git a/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue b/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue index 8d26014..15b24df 100644 --- a/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue +++ b/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue @@ -142,6 +142,7 @@ export default { }) this.$events.on('on-task-deleted', (task) => { + if (!this.masterTask) return this.masterTask.subtasks = this.masterTask.subtasks.filter((subtask) => subtask.id != task.id) }) diff --git a/app/src/plugins/tm@modal/task/z-delete-task-modal.vue b/app/src/plugins/tm@modal/task/z-delete-task-modal.vue index 1aa590f..a4f416a 100644 --- a/app/src/plugins/tm@modal/task/z-delete-task-modal.vue +++ b/app/src/plugins/tm@modal/task/z-delete-task-modal.vue @@ -43,9 +43,9 @@ export default { async deleteTask() { try { await this.$axios.delete(`v1/subtasks/${this.task.id}`) - // this.$emit('on-task-deleted', this.task) - + this.$store.commit('tm/delete_subtask', this.task) + this.$emit('on-task-deleted', this.task) this.closeModal() } catch (error) { this.$toast.error(error) 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 293c3a0..d758434 100644 --- a/app/src/plugins/tm@modal/task/z-task-modal.vue +++ b/app/src/plugins/tm@modal/task/z-task-modal.vue @@ -133,7 +133,7 @@ export default { this.$forceUpdate() }) - this.$events.on("on-task-deleted", (task) => { + this.$events.on('on-task-deleted', (task) => { if (task?.id == this.task?.id) this.closeModal() }) },