mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-20 12:48:52 +00:00
fix(checklists): allow scoring own items
This commit is contained in:
parent
20854057ad
commit
75c8486b1a
1 changed files with 2 additions and 1 deletions
|
|
@ -961,7 +961,8 @@ api.scoreCheckListItem = {
|
|||
if (!task || (!task.userId && !task.group.id)) throw new NotFound(res.t('messageTaskNotFound'));
|
||||
if (task.userId && task.userId !== user._id) {
|
||||
throw new BadRequest('Cannot score task belonging to another user.');
|
||||
} else if (user.guilds.indexOf(task.group.id) === -1 && user.party._id !== task.group.id) {
|
||||
} else if (task.group.id && user.guilds.indexOf(task.group.id) === -1
|
||||
&& user.party._id !== task.group.id) {
|
||||
throw new BadRequest('Cannot score task belonging to another user.');
|
||||
}
|
||||
if (task.type !== 'daily' && task.type !== 'todo') throw new BadRequest(res.t('checklistOnlyDailyTodo'));
|
||||
|
|
|
|||
Loading…
Reference in a new issue