feat: alle assignments en student's assignments geimplementeerd
This commit is contained in:
parent
7e051d412a
commit
e0a5596994
6 changed files with 77 additions and 24 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue