v3: fix tags tests

This commit is contained in:
Matteo Pagliazzi
2016-05-01 13:48:55 +02:00
parent a63d5ae97f
commit a8fbafb801
+2 -2
View File
@@ -83,7 +83,7 @@ schema.methods.syncToUser = async function syncChallengeToUser (user) {
// Sync tags
let userTags = user.tags;
let i = _.findIndex(userTags, {_id: challenge._id});
let i = _.findIndex(userTags, {id: challenge._id});
if (i !== -1) {
if (userTags[i].name !== challenge.shortName) {
@@ -92,7 +92,7 @@ schema.methods.syncToUser = async function syncChallengeToUser (user) {
}
} else {
userTags.push({
_id: challenge._id,
id: challenge._id,
name: challenge.shortName,
challenge: true,
});