mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-02 07:49:39 +00:00
fix trying to move completed todos
This commit is contained in:
parent
67bcfde6dc
commit
93fcc7957e
2 changed files with 3 additions and 1 deletions
|
|
@ -22,5 +22,6 @@
|
|||
"checklistOnlyDailyTodo": "Checklists are supported only on dailies and todos",
|
||||
"checklistItemNotFound": "No checklist item was wound with given id.",
|
||||
"itemIdRequired": "\"itemId\" must be a valid UUID",
|
||||
"positionRequired": "\"position\" is required and must be a number."
|
||||
"positionRequired": "\"position\" is required and must be a number.",
|
||||
"cantMoveCompletedTodo": "Can't move a completed todo."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -172,6 +172,7 @@ api.moveTask = {
|
|||
}).exec()
|
||||
.then((task) => {
|
||||
if (!task) throw new NotFound(res.t('taskNotFound'));
|
||||
if (task.type === 'todo' && task.completed) throw new NotFound(res.t('cantMoveCompletedTodo'));
|
||||
let order = user.tasksOrder[`${task.type}s`];
|
||||
let currentIndex = order.indexOf(task._id);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue