mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
fix trying to move completed todos
This commit is contained in:
@@ -22,5 +22,6 @@
|
|||||||
"checklistOnlyDailyTodo": "Checklists are supported only on dailies and todos",
|
"checklistOnlyDailyTodo": "Checklists are supported only on dailies and todos",
|
||||||
"checklistItemNotFound": "No checklist item was wound with given id.",
|
"checklistItemNotFound": "No checklist item was wound with given id.",
|
||||||
"itemIdRequired": "\"itemId\" must be a valid UUID",
|
"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()
|
}).exec()
|
||||||
.then((task) => {
|
.then((task) => {
|
||||||
if (!task) throw new NotFound(res.t('taskNotFound'));
|
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 order = user.tasksOrder[`${task.type}s`];
|
||||||
let currentIndex = order.indexOf(task._id);
|
let currentIndex = order.indexOf(task._id);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user