mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 21:57:22 +01:00
Aded challenge migration sync (#8492)
* Aded challenge migration sync * Fixed async grouping * Mapped promises and added error catching * Added placholders for syncing specific challenges * Prvented overriding of attribute and createdAt
This commit is contained in:
committed by
Sabe Jones
parent
db9befde17
commit
21ad808cc1
@@ -184,7 +184,7 @@ export async function getTasks (req, res, options = {}) {
|
||||
export function syncableAttrs (task) {
|
||||
let t = task.toObject(); // lodash doesn't seem to like _.omit on Document
|
||||
// only sync/compare important attrs
|
||||
let omitAttrs = ['_id', 'userId', 'challenge', 'history', 'tags', 'completed', 'streak', 'notes', 'updatedAt', 'group', 'checklist'];
|
||||
let omitAttrs = ['_id', 'userId', 'challenge', 'history', 'tags', 'completed', 'streak', 'notes', 'updatedAt', 'createdAt', 'group', 'checklist', 'attribute'];
|
||||
if (t.type !== 'reward') omitAttrs.push('value');
|
||||
return _.omit(t, omitAttrs);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user