fix(challenges): better screening

This commit is contained in:
SabreCat
2023-08-07 22:26:56 -05:00
parent c44b1670cf
commit ebd0cb72de
4 changed files with 18 additions and 4 deletions

View File

@@ -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
}