Merge branch 'dev' into refactor/linting
This commit is contained in:
commit
2490e61a78
27 changed files with 1541 additions and 157 deletions
|
@ -6,7 +6,7 @@ interface Translations {
|
|||
curricula_page: Record<string, { title: string; description?: string }>;
|
||||
}
|
||||
|
||||
export function getThemes(req: Request, res: Response): void {
|
||||
export function getThemesHandler(req: Request, res: Response): void {
|
||||
const language = (req.query.language as string).toLowerCase() || 'nl';
|
||||
const translations = loadTranslations<Translations>(language);
|
||||
const themeList = themes.map((theme) => ({
|
||||
|
@ -19,8 +19,14 @@ export function getThemes(req: Request, res: Response): void {
|
|||
res.json(themeList);
|
||||
}
|
||||
|
||||
export function getThemeByTitle(req: Request, res: Response): void {
|
||||
export function getHruidsByThemeHandler(req: Request, res: Response): void {
|
||||
const themeKey = req.params.theme;
|
||||
|
||||
if (!themeKey) {
|
||||
res.status(400).json({ error: 'Missing required field: theme' });
|
||||
return;
|
||||
}
|
||||
|
||||
const theme = themes.find((t) => t.title === themeKey);
|
||||
|
||||
if (theme) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue