fix(teams): make selectSingle workflows functional

This commit is contained in:
Sabe Jones
2021-04-13 16:42:50 -05:00
committed by SabreCat
parent 7dbee4caed
commit 74345adf6b
3 changed files with 31 additions and 25 deletions

View File

@@ -1489,20 +1489,23 @@ export default {
this.$emit('cancel');
},
async toggleAssignment (memberId) {
if (this.purpose === 'create') {
return;
}
if (this.purpose !== 'create') {
if (this.assignedMember === null) {
await this.$store.dispatch('tasks:unassignTask', {
taskId: this.task._id,
userId: memberId,
});
} else {
await this.$store.dispatch('tasks:unassignTask', {
taskId: this.task._id,
userId: this.assignedMember,
});
if (this.assignedMember === null) {
await this.$store.dispatch('tasks:unassignTask', {
taskId: this.task._id,
userId: memberId,
});
} else {
await this.$store.dispatch('tasks:assignTask', {
taskId: this.task._id,
userId: memberId,
});
await this.$store.dispatch('tasks:assignTask', {
taskId: this.task._id,
userId: memberId,
});
}
}
this.assignedMember = memberId;