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`) } }