From 6bf4193da9015efb162ccbca1ce1da9784f71221 Mon Sep 17 00:00:00 2001 From: Gabriellvl Date: Sun, 2 Mar 2025 12:10:59 +0100 Subject: [PATCH] fix: queries in routes van leer paden --- backend/src/routes/learningPaths.ts | 40 ++++++++++++----------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/backend/src/routes/learningPaths.ts b/backend/src/routes/learningPaths.ts index e196c0d3..ce580745 100644 --- a/backend/src/routes/learningPaths.ts +++ b/backend/src/routes/learningPaths.ts @@ -1,33 +1,27 @@ import express from 'express'; -import { - getLearningPaths, - getLearningPathsByTheme, - searchLearningPaths, -} from '../controllers/learningPaths.js'; +import { getLearningPaths } from '../controllers/learningPaths.js'; const router = express.Router(); // DWENGO learning paths -// Unified route for fetching learning paths -// Route 1: Query: hruid (list), language -// Fetch learning paths based on hruid list -// Example 1: http://localhost:3000/learningPath?hruids=pn_werking&hruids=art1 - -// Route 2: no query +// Route 1: no query // Fetch all learning paths -// Example 2: http://localhost:3000/learningPath ( +// 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); -// Query: language -// Route to fetch learning paths based on a searchterm -// Example: http://localhost:3000/learningPath/search?query=robot -router.get('/search', searchLearningPaths); - -// Arg: theme id -// Query: language -// Route to fetch learning paths based on a theme -// Example: http://localhost:3000/learningPath/theme/kiks -router.get('/theme/:theme', getLearningPathsByTheme); - export default router;