mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 14:17:22 +01:00
@@ -86,6 +86,11 @@ export async function createTasks (req, res, options = {}) {
|
||||
let taskType = taskData.type;
|
||||
let newTask = new Tasks[taskType](Tasks.Task.sanitize(taskData));
|
||||
|
||||
// Attempt to round priority
|
||||
if (newTask.priority && !Number.isNaN(Number.parseFloat(newTask.priority))) {
|
||||
newTask.priority = Number(newTask.priority.toFixed(1));
|
||||
}
|
||||
|
||||
if (challenge) {
|
||||
newTask.challenge.id = challenge.id;
|
||||
} else if (group) {
|
||||
|
||||
Reference in New Issue
Block a user