Fix email form server check and return error code if existing
This commit is contained in:
@@ -18,9 +18,9 @@ export const POST: RequestHandler = async ({ request }) => {
|
||||
})
|
||||
const res = await req.json()
|
||||
|
||||
if (res && res.email_address && res.status === 'PENDING') {
|
||||
if (res) {
|
||||
return new Response(JSON.stringify({
|
||||
code: 'PENDING'
|
||||
code: res.error ? res.error.code : res.status
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user