feat: toevoeging fallback language constante
This commit is contained in:
parent
008e2e1c2c
commit
6bb8c364b9
6 changed files with 12 additions and 8 deletions
|
@ -1,5 +1,6 @@
|
|||
import { Request, Response } from 'express';
|
||||
import { getLearningObjectsFromPath } from '../services/learningObjects.js';
|
||||
import {FALLBACK_LANG} from "../config";
|
||||
|
||||
export async function getAllLearningObjects(
|
||||
req: Request,
|
||||
|
@ -7,7 +8,7 @@ export async function getAllLearningObjects(
|
|||
): Promise<void> {
|
||||
try {
|
||||
const { hruid } = req.params;
|
||||
const language = (req.query.language as string) || 'nl'; // Default to Dutch;
|
||||
const language = (req.query.language as string) || FALLBACK_LANG;
|
||||
|
||||
if (!language) {
|
||||
res.status(400).json({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue