Merge branch 'dev' into lint-action-setup

This commit is contained in:
Tibo De Peuter 2025-03-04 21:45:46 +01:00
commit a4d34afcb3
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
32 changed files with 3116 additions and 2918 deletions

View file

@ -0,0 +1,27 @@
import express from 'express';
import {
getAllLearningObjects,
getLearningObject,
} from '../controllers/learningObjects.js';
const router = express.Router();
// DWENGO learning objects
// Queries: hruid(path), full, language
// Route to fetch list of learning objects based on hruid of learning path
// Route 1: list of object hruids
// Example 1: http://localhost:3000/learningObject?hruid=un_artificiele_intelligentie
// Route 2: list of object data
// Example 2: http://localhost:3000/learningObject?full=true&hruid=un_artificiele_intelligentie
router.get('/', getAllLearningObjects);
// Parameter: hruid of learning object
// Query: language
// Route to fetch data of one learning object based on its hruid
// Example: http://localhost:3000/learningObject/un_ai7
router.get('/:hruid', getLearningObject);
export default router;

View file

@ -0,0 +1,27 @@
import express from 'express';
import { getLearningPaths } from '../controllers/learningPaths.js';
const router = express.Router();
// DWENGO learning paths
// Route 1: no query
// Fetch all learning paths
// Example 1: http://localhost:3000/learningPath
// Unified route for fetching learning paths
// Route 2: Query: hruid (list), language
// Fetch learning paths based on hruid list
// Example 2: http://localhost:3000/learningPath?hruid=pn_werking&hruid=art1
// Query: search, language
// Route to fetch learning paths based on a searchterm
// Example 3: http://localhost:3000/learningPath?search=robot
// Query: theme, anguage
// Route to fetch learning paths based on a theme
// Example: http://localhost:3000/learningPath?theme=kiks
router.get('/', getLearningPaths);
export default router;

View file

@ -3,7 +3,12 @@ import { getThemes, getThemeByTitle } from '../controllers/themes.js';
const router = express.Router();
// Query: language
// Route to fetch list of {key, title, description, image} themes in their respective language
router.get('/', getThemes);
// Arg: theme (key)
// Route to fetch list of hruids based on theme
router.get('/:theme', getThemeByTitle);
export default router;