feat: test service student

This commit is contained in:
Gabriellvl 2025-03-24 15:20:51 +01:00
parent 5490bd6b86
commit 7ad944c77d
4 changed files with 103 additions and 14 deletions

View file

@ -1,7 +1,7 @@
import { Request, Response } from 'express';
import {
createStudent,
deleteStudent, getAllStudentIds,
deleteStudent,
getAllStudents,
getStudent,
getStudentAssignments,
@ -16,7 +16,7 @@ import { StudentDTO } from '../interfaces/student.js';
export async function getAllStudentsHandler(req: Request, res: Response): Promise<void> {
const full = req.query.full === 'true';
const students: StudentDTO[] | string[] = full ? await getAllStudents() : await getAllStudentIds();
const students: StudentDTO[] | string[] = await getAllStudents(full);
if (!students) {
res.status(404).json({ error: `Students not found.` });