feat: assignment/questions endpoint toegevoegd

This commit is contained in:
Adriaan Jacquet 2025-03-30 19:24:52 +02:00
parent 136dcb4c71
commit 62711f323d
7 changed files with 82 additions and 80 deletions

View file

@ -1,5 +1,5 @@
import { Request, Response } from 'express';
import { createClass, getAllClasses, getClass, getClassStudents, getClassStudentsIds, getClassTeacherInvitations } from '../services/classes.js';
import { createClass, getAllClasses, getClass, getClassStudents, getClassTeacherInvitations } from '../services/classes.js';
import { ClassDTO } from '../interfaces/class.js';
export async function getAllClassesHandler(req: Request, res: Response): Promise<void> {
@ -47,7 +47,7 @@ export async function getClassStudentsHandler(req: Request, res: Response): Prom
const classId = req.params.id;
const full = req.query.full === 'true';
const students = full ? await getClassStudents(classId) : await getClassStudentsIds(classId);
const students = getClassStudents(classId, full);
res.json({
students: students,

View file

@ -12,6 +12,7 @@ interface GroupParams {
export async function getGroupHandler(req: Request<GroupParams>, res: Response): Promise<void> {
const classId = req.params.classid;
const full = req.query.full === 'true';
const assignmentId = +req.params.assignmentid;
if (isNaN(assignmentId)) {