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':
|
case 'POST':
|
||||||
try {
|
try {
|
||||||
booking = await createBooking(req.body)
|
booking = await createBooking(req.body)
|
||||||
res.status(200).json(booking)
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof Error.ValidationError) {
|
if (e instanceof Error.ValidationError) {
|
||||||
res.status(400).json({ message: e.message, errors: e.errors })
|
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}`,
|
`send booking ${booking.uuid} received to {booking.email}`,
|
||||||
booking
|
booking
|
||||||
)
|
)
|
||||||
|
res.status(200).json(booking)
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
res.setHeader('Allow', ['POST'])
|
res.setHeader('Allow', ['POST'])
|
||||||
|
|||||||
Reference in New Issue
Block a user