Skip to content

Commit

Permalink
fix(challenges): filter out groups without perms
Browse files Browse the repository at this point in the history
  • Loading branch information
SabreCat committed Aug 19, 2023
1 parent 2803db7 commit 474fa53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions website/client/src/components/challenges/challengeModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,9 @@ export default {
methods: {
async shown () {
this.groups = await this.$store.dispatch('guilds:getMyGuilds');
this.groups = this.groups.filter(group => !(
group.leaderOnly.challenges && group.leader !== this.user._id
));
if (this.user.party && this.user.party._id) {
await this.$store.dispatch('party:getParty');
Expand Down
2 changes: 1 addition & 1 deletion website/server/controllers/api-v3/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ api.getGroups = {
throw new BadRequest(apiError('guildsOnlyPaginate'));
}

const groupFields = basicGroupFields.concat(' description memberCount balance');
const groupFields = basicGroupFields.concat(' description memberCount balance leaderOnly');
const sort = '-memberCount';

const filters = {};
Expand Down

0 comments on commit 474fa53

Please sign in to comment.