mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 21:27:23 +01:00
fix(challenges): better screening
This commit is contained in:
@@ -403,8 +403,12 @@ api.getUserChallenges = {
|
||||
orOptions.push({ leader: user._id });
|
||||
|
||||
if (!req.query.member) {
|
||||
const userGroups = await Group.getGroups({
|
||||
user,
|
||||
types: ['party', 'guilds', 'tavern'],
|
||||
});
|
||||
orOptions.push({
|
||||
group: { $in: user.getGroups() },
|
||||
group: { $in: userGroups },
|
||||
}); // Challenges in groups where I'm a member
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user