mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 21:27:23 +01:00
Challenge privacy fix (#11222)
* fix(challenges): filter out private content API-side * fix(challenges): cleaner fix + test
This commit is contained in:
@@ -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});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user