mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 14:17:22 +01:00
* Preventing adding duplicated task ID to taskOrder object when creating new tasks * refactor: not using Sets for taskOrderToAdd[] * refactor: remove unnecessary checking
This commit is contained in:
committed by
Matteo Pagliazzi
parent
52719ac685
commit
2741721161
@@ -116,7 +116,7 @@ export async function createTasks (req, res, options = {}) {
|
||||
|
||||
// Otherwise update the user/challenge/group
|
||||
if (!taskOrderToAdd[`${taskType}s`]) taskOrderToAdd[`${taskType}s`] = [];
|
||||
taskOrderToAdd[`${taskType}s`].unshift(newTask._id);
|
||||
if (!owner.tasksOrder[`${taskType}s`].includes(newTask._id)) taskOrderToAdd[`${taskType}s`].unshift(newTask._id);
|
||||
|
||||
return newTask;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user