Challenge privacy fix (#11222)

* fix(challenges): filter out private content API-side

* fix(challenges): cleaner fix + test
This commit is contained in:
Sabe Jones
2019-06-13 09:27:47 -05:00
committed by GitHub
parent 5630e8cc8e
commit 6b59262e3e
2 changed files with 25 additions and 3 deletions

View File

@@ -366,11 +366,11 @@ api.getUserChallenges = {
if (owned) {
if (owned === 'not_owned') {
query.$and = [{leader: {$ne: user._id}}];
query.$and.push({leader: {$ne: user._id}});
}
if (owned === 'owned') {
query.$and = [{leader: user._id}];
query.$and.push({leader: user._id});
}
}