mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
send response last
This commit is contained in:
@@ -20,7 +20,6 @@ export default async function userHandler(
|
||||
case 'POST':
|
||||
try {
|
||||
booking = await createBooking(req.body)
|
||||
res.status(200).json(booking)
|
||||
} catch (e) {
|
||||
if (e instanceof Error.ValidationError) {
|
||||
res.status(400).json({ message: e.message, errors: e.errors })
|
||||
@@ -42,6 +41,7 @@ export default async function userHandler(
|
||||
`send booking ${booking.uuid} received to {booking.email}`,
|
||||
booking
|
||||
)
|
||||
res.status(200).json(booking)
|
||||
break
|
||||
default:
|
||||
res.setHeader('Allow', ['POST'])
|
||||
|
||||
Reference in New Issue
Block a user