Skip to content

Commit

Permalink
feat(apply): invoke webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnl committed Apr 16, 2024
1 parent 20fa926 commit 0e5b6fa
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/routes/apply.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,20 @@ router.post("/submit", async (req, res) => {
status: "RECEIVED"
}
}, { upsert: true, new: true })
console.log(doc);

console.log(doc)
// give http response
res.json({status: "ok"})

// invoke webhook
const webhookData = {
firstName,
lastName,
city,
email,
username,
}
await axios.post(process.env.APPLY_WEBHOOK, webhookData)
} catch (e) {
console.log(e)
res.status(500).json({status: "error"})
Expand Down

0 comments on commit 0e5b6fa

Please sign in to comment.