feat: extra learning object routes
This commit is contained in:
		
							parent
							
								
									8d5377e28e
								
							
						
					
					
						commit
						484120ab50
					
				
					 1 changed files with 16 additions and 5 deletions
				
			
		|  | @ -1,14 +1,25 @@ | |||
| import express from 'express'; | ||||
| import { getAllLearningObjects } from '../controllers/learningObjects.js'; | ||||
| import {getAllLearningObjects, getLearningObject} from '../controllers/learningObjects.js'; | ||||
| 
 | ||||
| const router = express.Router(); | ||||
| 
 | ||||
| // DWENGO learning objects
 | ||||
| 
 | ||||
| // Arg: hruid learningPath
 | ||||
| // Query: language
 | ||||
| // Queries: hruid(path), full, language
 | ||||
| // Route to fetch list of learning objects based on hruid of learning path
 | ||||
| // Example: http://localhost:3000/learningObject/un_artificiele_intelligentie
 | ||||
| router.get('/:hruid', getAllLearningObjects); | ||||
| 
 | ||||
| // 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; | ||||
|  |  | |||
		Reference in a new issue
	
	 Gabriellvl
						Gabriellvl