mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-13 01:38:45 +00:00
fix(teams): allow managers to reorder tasks
This commit is contained in:
parent
395d9e7650
commit
1752c08fd9
1 changed files with 3 additions and 2 deletions
|
|
@ -149,14 +149,15 @@ api.groupMoveTask = {
|
|||
|
||||
if (task.type === 'todo' && task.completed) throw new BadRequest(res.t('cantMoveCompletedTodo'));
|
||||
|
||||
const groupFields = requiredGroupFields.concat(' managers');
|
||||
const group = await Group.getGroup({
|
||||
user,
|
||||
groupId: task.group.id,
|
||||
fields: requiredGroupFields,
|
||||
fields: groupFields,
|
||||
});
|
||||
if (!group) throw new NotFound(res.t('groupNotFound'));
|
||||
|
||||
if (group.leader !== user._id) throw new NotAuthorized(res.t('onlyGroupLeaderCanEditTasks'));
|
||||
if (canNotEditTasks(group, user)) throw new NotAuthorized(res.t('onlyGroupLeaderCanEditTasks'));
|
||||
|
||||
const order = group.tasksOrder[`${task.type}s`];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue