This might work

This commit is contained in:
Ella 2022-11-10 11:08:32 -05:00
parent 076f9adef4
commit ef7d5049a6
2 changed files with 7 additions and 2 deletions

View file

@ -63,7 +63,10 @@ export default function Signup() {
const handleSubmit = async e => {
e.preventDefault()
setSubmitted(true)
fetch('/api/bank/demo', {
method: 'POST',
body: JSON.stringify(values)
})
// clear form
setValues({

View file

@ -35,7 +35,9 @@ export default async function handler(req, res) {
Status: 'Demo Account',
'HCB account URL': `https://bank.hackclub.com/${r.slug}`
})
res.send('Success! Check your email for next steps.').end()
res
.status(200)
.json({ message: 'Success! Check your email for next steps.' })
})
.catch(error => {
console.log(error)