From d59c61e2e2b3d0118e33295ce7cafa1d7dc8077d Mon Sep 17 00:00:00 2001 From: Adriaan Jacquet Date: Mon, 7 Apr 2025 17:33:03 +0200 Subject: [PATCH] feat: frontend controller endpoints voor add en delete teacher en student van een klas --- frontend/src/controllers/classes.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/frontend/src/controllers/classes.ts b/frontend/src/controllers/classes.ts index 6a5f489c..c6c80af0 100644 --- a/frontend/src/controllers/classes.ts +++ b/frontend/src/controllers/classes.ts @@ -46,10 +46,26 @@ export class ClassController extends BaseController { return this.get(`/${id}/students`, { full }); } + async addStudent(id: string, username: string): Promise { + return this.post(`/${id}/students`, { username }); + } + + async deleteStudent(id: string, username: string): Promise { + return this.delete(`/${id}/students/${ username }`); + } + async getTeachers(id: string, full = true): Promise { return this.get(`/${id}/teachers`, { full }); } + async addTeacher(id: string, username: string): Promise { + return this.post(`/${id}/teachers`, { username }); + } + + async deleteTeacher(id: string, username: string): Promise { + return this.delete(`/${id}/teachers/${ username }`); + } + async getTeacherInvitations(id: string, full = true): Promise { return this.get(`/${id}/teacher-invitations`, { full }); }