fix(teams): allow ticking team checklists

This commit is contained in:
Sabe Jones
2021-08-13 16:46:44 -05:00
committed by SabreCat
parent 029e41472f
commit 63e0875f32
2 changed files with 4 additions and 4 deletions

View File

@@ -966,9 +966,9 @@ api.scoreCheckListItem = {
if (validationErrors) throw validationErrors;
const { taskId } = req.params;
const task = await Tasks.Task.findByIdOrAlias(taskId, user._id, { userId: user._id });
const task = await Tasks.Task.findById(taskId);
if (!task) throw new NotFound(res.t('messageTaskNotFound'));
if (!task || (!task.id && !task.group.id)) throw new NotFound(res.t('taskNotFound'));
if (task.type !== 'daily' && task.type !== 'todo') throw new BadRequest(res.t('checklistOnlyDailyTodo'));
const item = _.find(task.checklist, { id: req.params.itemId });