Skip to content

Commit

Permalink
fix(apply): pass appliedAt also to webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnl committed Apr 16, 2024
1 parent 0e5b6fa commit ac8bdd6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/routes/apply.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,14 @@ router.post("/submit", async (req, res) => {
if (resultDiscord?.associationMembership.status == 'MEMBER') throw "dc already assoc member"

// upsert application
const appliedAt = new Date();
const doc = await database.UserInfo.findOneAndUpdate({ id }, {
associationMembership: {
firstName,
lastName,
city,
email,
appliedAt: new Date(),
appliedAt,
status: "RECEIVED"
}
}, { upsert: true, new: true })
Expand All @@ -116,6 +117,7 @@ router.post("/submit", async (req, res) => {
city,
email,
username,
appliedAt
}
await axios.post(process.env.APPLY_WEBHOOK, webhookData)
} catch (e) {
Expand Down

0 comments on commit ac8bdd6

Please sign in to comment.