feat(bookings): implement booking system and confirmation flow
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
This commit is contained in:
15
server/api/public/bookings/[token].get.ts
Normal file
15
server/api/public/bookings/[token].get.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
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
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user