mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-28 15:31:11 -04:00
14 lines
519 B
TypeScript
14 lines
519 B
TypeScript
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);
|
|
});
|