mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
fix tasks updating and reminders tests
This commit is contained in:
@@ -304,24 +304,7 @@ api.updateTask = {
|
||||
throw new NotFound(res.t('taskNotFound'));
|
||||
}
|
||||
|
||||
// If reminders are updated -> replace the original ones
|
||||
if (req.body.reminders) {
|
||||
task.reminders = req.body.reminders;
|
||||
delete req.body.reminders;
|
||||
}
|
||||
|
||||
// If checklist is updated -> replace the original one
|
||||
if (req.body.checklist) {
|
||||
task.checklist = req.body.checklist;
|
||||
delete req.body.checklist;
|
||||
}
|
||||
|
||||
// If tags are updated -> replace the original ones
|
||||
if (req.body.tags) {
|
||||
task.tags = req.body.tags;
|
||||
delete req.body.tags;
|
||||
}
|
||||
|
||||
Tasks.Task.sanitize(req.body);
|
||||
// TODO we have to convert task to an object because otherwise things don't get merged correctly. Bad for performances?
|
||||
// TODO regarding comment above, make sure other models with nested fields are using this trick too
|
||||
_.assign(task, common.ops.updateTask(task.toObject(), req));
|
||||
|
||||
Reference in New Issue
Block a user