Skip to content

Commit

Permalink
fix: check for required fields (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
daine authored Apr 26, 2024
1 parent 8eedc75 commit 1c49657
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ app.post('/submission', async (req, res) => {
return
}

// Check for required fields
if(!name || !email || !message || !reasonForContact) {
console.warn('[WARN] Missing required fields')
res.status(204).send()
return
}

// Send to Notify
const headData = {
'Authorization': `ApiKey-v1 ${NOTIFY_API_KEY}`,
Expand Down

0 comments on commit 1c49657

Please sign in to comment.