mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 14:37:13 +01:00
21 lines
437 B
JavaScript
21 lines
437 B
JavaScript
import { getBookingByUUID, createBooking } from '../../../db/index'
|
|
|
|
export default async function userHandler(req, res) {
|
|
const {
|
|
method,
|
|
query: { uuid },
|
|
} = req
|
|
|
|
let booking
|
|
|
|
switch (method) {
|
|
case 'GET':
|
|
booking = await getBookingByUUID(uuid)
|
|
res.status(200).json(booking)
|
|
break
|
|
default:
|
|
res.setHeader('Allow', ['POST'])
|
|
res.status(405).end(`Method ${method} Not Allowed`)
|
|
}
|
|
}
|