Skip to content

Commit

Permalink
Add hack.af in SDP /promo
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwofford committed Oct 7, 2019
1 parent 1a3b4bf commit 17e587c
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions src/interactions/promo.js
Expand Up @@ -6,9 +6,33 @@ import {
} from '../utils'

const sdpLink = club =>
`https://airtable.com/shrlf0NgVfVBI51hU?prefill_Club%20Slack%20Channel%20ID=${
club.fields['Slack Channel ID']
}`
new Promise((resolve, reject) => {
const formUrl = `https://airtable.com/shrlf0NgVfVBI51hU?prefill_Club%20Slack%20Channel%20ID=${
club.fields['Slack Channel ID']
}`

airFind('Links', 'destination', formUrl, 'hackaf')
.then(entry => {
if (entry) {
resolve(entry.fields['slug'])
}
const newRecord = {
slug: `sdp-${club.fields['Slack Channel ID']}`,
destination: formUrl,
Notes: `Created by @orpheus to use for SDP activations`,
}
return airCreate('Links', newRecord, 'hackaf')
.then(entry => {
resolve(entry.fields['slug'])
})
.catch(err => {
reject(err)
})
})
.catch(err => {
reject(err)
})
})

const promos = [
{
Expand Down

0 comments on commit 17e587c

Please sign in to comment.