feat: add hub
This commit is contained in:
@@ -4,7 +4,7 @@ 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 is not set` })
|
||||
throw createError({ statusCode: 500, statusMessage: `NUXT_BASEROW_${table.toUpperCase()}_TABLE_ID ist nicht gesetzt` })
|
||||
}
|
||||
return id
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ export async function mediumOptionId(event: H3Event, medium: Medium): Promise<nu
|
||||
const options = (await fields(event)).find(field => field.name === 'medium')?.select_options ?? []
|
||||
const id = options.find(option => toMedium(option.value) === medium)?.id
|
||||
if (!id) {
|
||||
throw createError({ statusCode: 500, statusMessage: `The medium field has no "${MEDIUMS[medium].label}" option` })
|
||||
throw createError({ statusCode: 500, statusMessage: `Das Feld medium hat keine Option "${MEDIUMS[medium].label}"` })
|
||||
}
|
||||
return id
|
||||
}
|
||||
@@ -69,7 +69,7 @@ export async function mediumOptionId(event: H3Event, medium: Medium): Promise<nu
|
||||
export async function booksTableId(event: H3Event): Promise<string> {
|
||||
const id = (await fields(event)).find(field => field.name === 'books')?.link_row_table_id
|
||||
if (!id) {
|
||||
throw createError({ statusCode: 500, statusMessage: 'The reviews table has no "books" link field' })
|
||||
throw createError({ statusCode: 500, statusMessage: 'Die Rezensionen-Tabelle hat kein Verknüpfungsfeld "books"' })
|
||||
}
|
||||
return String(id)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user