Skip to content

Commit a1a9a6c

Browse files
committed
Hook up new questions to Airtable
1 parent 9ff9124 commit a1a9a6c

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

pages/api/fiscal-sponsorship/apply.js

+9-13
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ export default async function handler(req, res) {
1919
body: JSON.stringify({
2020
email: data.userEmail,
2121
name: data.eventName,
22-
country: getCode(data.eventLocation) || '',
23-
postal_code: data.eventPostalCode || '',
24-
transparent: data.transparent
22+
country: getCode(data.userAddressCountry) || '',
23+
postal_code: data.userAddressPostalCode || '',
24+
transparent: 'false'
2525
}),
2626
method: 'POST',
2727
headers: {
@@ -39,16 +39,13 @@ export default async function handler(req, res) {
3939
'Date of Birth': data.userBirthday,
4040
'Event Name': data.eventName,
4141
'Event Website': data.eventWebsite,
42-
'Zip Code': data.eventPostalCode,
42+
'Zip Code': data.userAddressPostalCode,
4343
'Tell us about your event': data.eventDescription,
44-
'Mailing Address': data.userAddress,
45-
'Address Line 1': data.addressLine1,
46-
City: data.addressCity,
47-
State: data.addressState,
48-
'Address Country': data.addressCountry,
49-
'Address Country Code': data.addressCountryCode,
50-
'Event Location': data.eventLocation,
51-
'Event Country Code': data.eventCountryCode,
44+
'Address Line 1': data.userAddressLine1,
45+
City: data.userAddressCity,
46+
State: data.userAddressProvince,
47+
'Address Country': data.userAddressCountry,
48+
'Event Location': data.userAddressCountry,
5249
'Have you used HCB for any previous events?':
5350
data.returningUser === 'true'
5451
? 'Yes, I have used HCB before'
@@ -65,7 +62,6 @@ export default async function handler(req, res) {
6562
'(Adults) Annual Budget': parseInt(data.eventAnnualBudget),
6663
'HCB ID': r.id
6764
})
68-
res.status(200).end();
6965
})
7066
.catch(error => {
7167
console.error(error)

0 commit comments

Comments
 (0)