This commit is contained in:
Belle 2022-12-07 16:19:06 -05:00
parent 26eb702fc8
commit 1a9c5eb480
2 changed files with 17 additions and 11 deletions

View file

@ -51,7 +51,8 @@ const Rsvp = () => {
},
body: JSON.stringify({
Name: e.target.name.value,
Email: e.target.email.value
Email: e.target.email.value,
Age: e.target.age.value
})
})
@ -112,17 +113,21 @@ const Rsvp = () => {
required
/>
</div>
<div>
<Label htmlFor="age">Under 18?</Label>
<Input type="checkbox" name="age" id="age" checked/>
</div>
<Zoom delay={200}>
<Button type="submit" sx={{ mt: [2, 0] }}>
{submitting ? (
<>
<Loading />
&nbsp;RSVP
</>
) : (
'RSVP'
)}
</Button>
<Button type="submit" sx={{ mt: [2, 0] }}>
{submitting ? (
<>
<Loading />
&nbsp;RSVP
</>
) : (
'RSVP'
)}
</Button>
</Zoom>
</Grid>

View file

@ -11,6 +11,7 @@ export default async function handler(req, res) {
const rsvp = await airtable.create({
Name: req.body.Name,
Email: req.body.Email,
Age: req.body.Age,
IP: req.headers['x-forwarded-for'] || req.socket.remoteAddress
})
const url = process.env.WOM_SLACK_WEBHOOK_URL