feat(teams): new disapproval workflow, managers can uncheck tasks

This commit is contained in:
Sabe Jones
2021-04-23 15:47:58 -05:00
committed by SabreCat
parent bb9ba61d12
commit a5680836bd
4 changed files with 44 additions and 9 deletions

View File

@@ -56,11 +56,15 @@ export default {
const canScoreTask = await this.beforeTaskScore(task);
if (!canScoreTask) return;
try {
scoreTask({ task, user, direction });
} catch (err) {
this.text(err.message);
return;
if (direction === 'down' && task.group.completedBy && task.group.completedBy !== user._id) {
task.completed = false;
} else {
try {
scoreTask({ task, user, direction });
} catch (err) {
this.text(err.message);
return;
}
}
this.playTaskScoreSound(task, direction);