diff --git a/common/locales/en/api-v3.json b/common/locales/en/api-v3.json index d9fb392743..9f4346c414 100644 --- a/common/locales/en/api-v3.json +++ b/common/locales/en/api-v3.json @@ -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." } diff --git a/website/src/controllers/api-v3/tasks.js b/website/src/controllers/api-v3/tasks.js index c6209de2a4..e4ba525115 100644 --- a/website/src/controllers/api-v3/tasks.js +++ b/website/src/controllers/api-v3/tasks.js @@ -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);