Add database tables and repository for managing bookings Create API endpoints for booking submission and capacity management Update landing page to persist bookings before WhatsApp redirection
16 lines
438 B
TypeScript
16 lines
438 B
TypeScript
import { getRequiredRouteParam, httpError } from '../../../utils/http'
|
|
import { getBookingByConfirmationToken } from '../../../utils/booking-repository'
|
|
|
|
export default defineEventHandler(async (event) => {
|
|
const token = getRequiredRouteParam(event, 'token', 'Confirmation token')
|
|
const booking = await getBookingByConfirmationToken(token)
|
|
|
|
if (!booking) {
|
|
httpError(404, 'Booking not found')
|
|
}
|
|
|
|
return {
|
|
booking
|
|
}
|
|
})
|