From 5ce0faba49f4c3f38cece75995a4ed98a60ebdf8 Mon Sep 17 00:00:00 2001 From: Max Wofford Date: Sat, 18 Jan 2020 10:07:23 -0800 Subject: [PATCH] Fix invalid clubs lookup in /leader-add --- src/interactions/leaderAdd.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interactions/leaderAdd.js b/src/interactions/leaderAdd.js index f3a1cf28..fec4654e 100644 --- a/src/interactions/leaderAdd.js +++ b/src/interactions/leaderAdd.js @@ -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], })