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:
18
server/utils/app-url.ts
Normal file
18
server/utils/app-url.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
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()
|
||||
}
|
||||
Reference in New Issue
Block a user