Skip to content

Commit

Permalink
Fix invalid clubs lookup in /leader-add
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwofford committed Jan 18, 2020
1 parent bf9e6b3 commit 5ce0fab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/interactions/leaderAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ const interactionLeaderAdd = async (bot, message) => {
throw transcript('leaderAdd.invalidChannel')
}

const taggedUserClubs = taggedUser.fields['Clubs'] || []
const taggedUserClubs = taggedUser.person.fields['Clubs'] || []
if (taggedUserClubs.includes(recipientClub)) {
throw transcript('leaderAdd.alreadyLeader')
}

await airPatch('People', taggedUser.id, {
await airPatch('People', taggedUser.person.id, {
Clubs: [...taggedUserClubs, recipientClub],
})

Expand Down

0 comments on commit 5ce0fab

Please sign in to comment.