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
19 lines
433 B
TypeScript
19 lines
433 B
TypeScript
import type { H3Event } from 'h3'
|
|
|
|
import { getRequestURL } from 'h3'
|
|
|
|
export function getAppOrigin(event: H3Event) {
|
|
const config = useRuntimeConfig()
|
|
|
|
if (config.public.appUrl) {
|
|
return new URL(config.public.appUrl).origin
|
|
}
|
|
|
|
const url = getRequestURL(event)
|
|
return `${url.protocol}//${url.host}`
|
|
}
|
|
|
|
export function buildAppUrl(event: H3Event, path: string) {
|
|
return new URL(path, getAppOrigin(event)).toString()
|
|
}
|