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:
@@ -131,6 +131,14 @@ TaskSchema.plugin(baseModel, {
|
||||
delete taskObj.value;
|
||||
}
|
||||
|
||||
if (taskObj.priority) {
|
||||
let parsedFloat = Number.parseFloat(taskObj.priority);
|
||||
|
||||
if (!Number.isNaN(parsedFloat)) {
|
||||
taskObj.priority = parsedFloat.toFixed(1);
|
||||
}
|
||||
}
|
||||
|
||||
return taskObj;
|
||||
},
|
||||
private: [],
|
||||
|
||||
Reference in New Issue
Block a user