mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
round priority on update too (#10186)
* round priority on update too * move the fix to Task sanitizeTransform * refactor the task.priority parsing
This commit is contained in:
@@ -458,7 +458,6 @@ api.updateTask = {
|
||||
let oldCheckList = task.checklist;
|
||||
// we have to convert task to an object because otherwise things don't get merged correctly. Bad for performances?
|
||||
let [updatedTaskObj] = common.ops.updateTask(task.toObject(), req);
|
||||
|
||||
// Sanitize differently user tasks linked to a challenge
|
||||
let sanitizedObj;
|
||||
|
||||
@@ -471,6 +470,7 @@ api.updateTask = {
|
||||
}
|
||||
|
||||
_.assign(task, sanitizedObj);
|
||||
|
||||
// console.log(task.modifiedPaths(), task.toObject().repeat === tep)
|
||||
// repeat is always among modifiedPaths because mongoose changes the other of the keys when using .toObject()
|
||||
// see https://github.com/Automattic/mongoose/issues/2749
|
||||
@@ -481,7 +481,6 @@ api.updateTask = {
|
||||
}
|
||||
|
||||
setNextDue(task, user);
|
||||
|
||||
let savedTask = await task.save();
|
||||
|
||||
if (group && task.group.id && task.group.assignedUsers.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user