feat: endpoints voor /, /:id en /:id/students in routes/class.ts zijn geimplementeerd

This commit is contained in:
Adriaan Jacquet 2025-03-05 16:31:27 +01:00
parent 123fdf0fa1
commit 241fe0103f
7 changed files with 95 additions and 34 deletions

View file

@ -1,17 +1,18 @@
import { Request, Response } from 'express';
import { getStudent, getStudentClasses, getStudentClassIds } from '../services/students';
import { getAllStudents, getStudent, getStudentClasses, getStudentClassIds } from '../services/students';
import { ClassDTO } from '../interfaces/classes';
// TODO: accept arguments (full, ...)
// TODO: endpoints
export async function getAllStudentsHandler (
req: Request,
res: Response,
): Promise<void> {
try {
const students = await getAllStudents();
res.json({
students: [
'0',
'1',
]
students: students
});
} catch (error) {
console.error('Error fetching learning objects:', error);