feat: controller en service laag toegevoegd voor student/:id/classes

This commit is contained in:
Adriaan Jacquet 2025-03-04 15:50:20 +01:00
parent f5b6a5a604
commit ceef74f1af
6 changed files with 127 additions and 23 deletions

View file

@ -1,27 +1,15 @@
import express from 'express'
import { getStudentById } from '../services/students';
import { getStudent } from '../controllers/students';
import { getAllStudentsHandler, getStudentClassesHandler, getStudentHandler } from '../controllers/students';
const router = express.Router();
// root endpoint used to search objects
router.get('/', (req, res) => {
res.json({
students: [
'0',
'1',
]
});
});
router.get('/', getAllStudentsHandler);
// information about a student's profile
router.get('/:id', getStudent);
router.get('/:id', getStudentHandler);
// the list of classes a student is in
router.get('/:id/classes', (req, res) => {
res.json({
classes: [ '0' ],
});
})
router.get('/:id/classes', getStudentClassesHandler);
// the list of submissions a student has made
router.get('/:id/submissions', (req, res) => {