import { getLocale, loadConfig } from '~~/server/data.ts'; import { getSourcesEntries } from '~~/server/sources.ts'; export default defineEventHandler(async (event) => { const locale = getLocale(event); checkIsConfigEnabledOr404(await loadConfig(locale), 'sources'); const pronounsFilter = getQuery(event).pronoun as string | undefined; const { isGranted } = await useAuthentication(event); const db = useDatabase(); return await getSourcesEntries(db, isGranted, locale, pronounsFilter); });