From 4defe4c28a7afc29d78183cb5806817590a04ec4 Mon Sep 17 00:00:00 2001 From: konrad Date: Fri, 2 Oct 2020 16:40:04 +0000 Subject: [PATCH] Fix Assignees being deleted when adding a due date (#254) Use a model to make sure all changes of task assignees are bubbled back up to the task Co-authored-by: kolaente Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/254 Co-Authored-By: konrad Co-Committed-By: konrad --- src/components/tasks/partials/editAssignees.vue | 14 ++++++++------ src/views/tasks/TaskDetailView.vue | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/tasks/partials/editAssignees.vue b/src/components/tasks/partials/editAssignees.vue index d21825975..57473fc88 100644 --- a/src/components/tasks/partials/editAssignees.vue +++ b/src/components/tasks/partials/editAssignees.vue @@ -65,13 +65,12 @@ export default { type: Number, required: true, }, - initialAssignees: { - type: Array, - default: () => [], - }, disabled: { default: false, }, + value: { + type: Array, + }, }, data() { return { @@ -83,19 +82,22 @@ export default { } }, created() { - this.assignees = this.initialAssignees + this.assignees = this.value this.listUserService = new ListUserService() this.newAssignee = new UserModel() this.taskAssigneeService = new TaskAssigneeService() }, watch: { - initialAssignees(newVal) { + value(newVal) { this.assignees = newVal }, }, methods: { addAssignee(user) { this.$store.dispatch('tasks/addAssignee', {user: user, taskId: this.taskId}) + .then(() => { + this.$emit('input', this.assignees) + }) .catch(e => { this.error(e, this) }) diff --git a/src/views/tasks/TaskDetailView.vue b/src/views/tasks/TaskDetailView.vue index 765f9f465..59c12aeaf 100644 --- a/src/views/tasks/TaskDetailView.vue +++ b/src/views/tasks/TaskDetailView.vue @@ -32,10 +32,10 @@