From 13c9a460059e03fa5721324a84bb2f4b977c72ce Mon Sep 17 00:00:00 2001 From: Max Wofford Date: Wed, 18 Sep 2019 14:07:48 -0400 Subject: [PATCH] Update leaderAdd.js --- src/interactions/leaderAdd.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/interactions/leaderAdd.js b/src/interactions/leaderAdd.js index efa0b5ed..e4f54920 100644 --- a/src/interactions/leaderAdd.js +++ b/src/interactions/leaderAdd.js @@ -58,10 +58,8 @@ const interactionLeaderAdd = (bot, message) => { // ensure we can assign the leader to this club console.log(taggedUser.leader) console.log(commandUser.club.id, taggedUser.leader.fields['Clubs']) - const clubs = [ - commandUser.club.id, - ...taggedUser.leader.fields['Clubs'], - ] + const clubs = taggedUser.leader.fields['Clubs'] || [] + clubs.push(commandUser.club.id) console.log(clubs) return airPatch('Leaders', taggedUser.leader.id, { Clubs: clubs }).then( () => {