mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 21:27:23 +01:00
Group plans remove unlinked tasks (#8332)
* Added ability to delete tasks that are broken * Added ability to delete group tasks after leaving group
This commit is contained in:
@@ -954,7 +954,7 @@ api.deleteTask = {
|
||||
throw new NotFound(res.t('taskNotFound'));
|
||||
} else if (task.userId && task.challenge.id && !task.challenge.broken) {
|
||||
throw new NotAuthorized(res.t('cantDeleteChallengeTasks'));
|
||||
} else if (task.group.id && task.group.assignedUsers.indexOf(user._id) !== -1) {
|
||||
} else if (task.group.id && task.group.assignedUsers.indexOf(user._id) !== -1 && !task.group.broken) {
|
||||
throw new NotAuthorized(res.t('cantDeleteAssignedGroupTasks'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user