mirror of
https://github.com/marcogll/AnchorOS.git
synced 2026-03-15 20:24:34 +00:00
- Crear route /api/bookings con POST y GET - Validar disponibilidad de staff y recursos - Crear cliente si no existe - Generar short_id para reservas - Utilizar RPC functions de disponibilidad - Agregar utilidad generateShortId
12 lines
305 B
TypeScript
12 lines
305 B
TypeScript
import { supabaseAdmin } from '@/lib/supabase/client'
|
|
|
|
export async function generateShortId(): Promise<string> {
|
|
const { data, error } = await supabaseAdmin.rpc('generate_short_id')
|
|
|
|
if (error) {
|
|
throw new Error(`Failed to generate short_id: ${error.message}`)
|
|
}
|
|
|
|
return data as string
|
|
}
|