Skip to content

Commit

Permalink
Add Leaders v2 to /airtable
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwofford committed Oct 25, 2021
1 parent 63cc8e6 commit 755dce9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/interactions/airtable.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export default async (bot, message) => {
if (info.address && info.address.id) {
results.addressAirtableRecord = `<https://airtable.com/tblbcZKrj9gFPzj1l/${info.address.id}?blocks=hide|Address record>`
}
if (info.leaderV2) {
results.leaderV2Record = `<https://airtable.com/tblF84agXEjAX9pOh/${info.leaderV2.id}?blocks=hide|Leader V2 record>`
results.leaderV2Status = info.leaderV2.fields['Status']
}
if (info.club && info.club.id) {
results.clubAirtableRecord = `<https://airtable.com/tbloCEFJtbxsKYJEv/${info.club.id}?blocks=hide|Club record>`
}
Expand Down
6 changes: 6 additions & 0 deletions src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ bases.som = new Airtable({ apiKey: process.env.AIRTABLE_KEY }).base(
bases.conduct = new Airtable({ apiKey: process.env.AIRTABLE_KEY }).base(
'appWBF7Y4iVV3dI5q'
)
bases.clubsV2 = new Airtable({ apiKey: process.env.AIRTABLE_KEY }).base(
'appSUAc40CDu6bDAp'
)

const airtableRatelimiter = new Bottleneck({
// maxConcurrent: 5,
Expand Down Expand Up @@ -273,6 +276,9 @@ export const getInfoForUser = user =>
results.permissionedAmbassador = ambassador.fields['Permissioned']
}
}),
airFind('Club Leaders', 'Slack ID', user, { base: 'clubsV2' }).then(leaderV2 => {
results.leaderV2 = leaderV2
})
])
.then(async () => {
if (!results.person && results.slackUser) {
Expand Down

0 comments on commit 755dce9

Please sign in to comment.