simplify some tests, replace tags when updating tags (like for checklist)

This commit is contained in:
Matteo Pagliazzi
2015-12-06 17:29:14 +01:00
parent 582aeafb4b
commit 66a675c5b0
4 changed files with 17 additions and 34 deletions

View File

@@ -174,6 +174,13 @@ api.updateTask = {
delete req.body.checklist;
task.checklist = req.body.checklist;
}
// If tags are updated -> replace the original ones
if (req.body.tags) {
delete req.body.tags;
task.tags = req.body.tags;
}
// TODO merge goes deep into objects, it's ok?
// TODO also check that array and mixed fields are updated correctly without marking modified
_.merge(task, Tasks.Task.sanitizeUpdate(req.body));