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