Files
website/layers/diary/server/utils/diaryTable.ts
T
2026-10-03 23:57:41 +02:00

11 lines
409 B
TypeScript

import type { H3Event } from 'h3'
export function diaryTable(event: H3Event, table: 'reviews' | 'notes'): string {
const config = useRuntimeConfig(event)
const id = { reviews: config.baserowReviewsTableId, notes: config.baserowNotesTableId }[table]
if (!id) {
throw createError({ statusCode: 500, statusMessage: `NUXT_BASEROW_${table.toUpperCase()}_TABLE_ID ist nicht gesetzt` })
}
return id
}