fix trying to move completed todos

This commit is contained in:
Matteo Pagliazzi
2015-11-30 20:22:22 +01:00
parent 67bcfde6dc
commit 93fcc7957e
2 changed files with 3 additions and 1 deletions

View File

@@ -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);