mirror of
https://github.com/System-End/site.git
synced 2026-04-19 22:05:11 +00:00
Possibly fix form taking 30 secs
This commit is contained in:
parent
ac9f049498
commit
f848f97e15
1 changed files with 3 additions and 3 deletions
|
|
@ -13,6 +13,7 @@ export default async (req, res) => {
|
|||
if (req.method !== 'POST') {
|
||||
return res.status(405).json({ error: 'Method not allowed, use POST' })
|
||||
}
|
||||
res.status(200).json({ status: 'success' })
|
||||
|
||||
let data = JSON.parse(req?.body || '{}')
|
||||
const exists = await isDuplicate(data.name, data.email, data.reason)
|
||||
|
|
@ -42,9 +43,9 @@ export default async (req, res) => {
|
|||
type: 'mrkdwn',
|
||||
text: `*Full name:* ${data.name}\n*Email:* ${
|
||||
data.email
|
||||
}\n*Student:* ${data.teen ? 'true' : 'false'}\n*Reason:* ${
|
||||
}\n*Student:* ${data.teen ? 'true' : 'false'}\n*Reason:* ${
|
||||
data.reason
|
||||
}`
|
||||
}`
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -84,7 +85,6 @@ export default async (req, res) => {
|
|||
}).catch(err => console.error(err))
|
||||
}
|
||||
}
|
||||
res.status(200).json({ status: 'success' })
|
||||
}
|
||||
|
||||
async function isDuplicate(name, email, reason) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue