feat: alle assignments en student's assignments geimplementeerd

This commit is contained in:
Adriaan Jacquet 2025-03-09 15:31:10 +01:00
parent 7e051d412a
commit e0a5596994
6 changed files with 77 additions and 24 deletions

View file

@ -1,12 +1,26 @@
import { Request, Response } from 'express'
import { getAssignment } from '../services/assignments';
import { getAllAssignments, getAssignment } from '../services/assignments';
// typescript is annoywith with parameter forwarding from class.ts
// typescript is annoy with with parameter forwarding from class.ts
interface AssignmentParams {
classid: string;
id: string;
}
export async function getAllAssignmentsHandler(
req: Request<AssignmentParams>,
res: Response,
): Promise<void> {
const classid = req.params.classid;
const full = req.query.full === 'true';
const assignments = await getAllAssignments(classid, full);
res.json({
assignments: assignments,
});
}
export async function getAssignmentHandler(
req: Request<AssignmentParams>,
res: Response,