diff --git a/frontend/src/controllers/classes.ts b/frontend/src/controllers/classes.ts new file mode 100644 index 00000000..ed99dc0b --- /dev/null +++ b/frontend/src/controllers/classes.ts @@ -0,0 +1,33 @@ +import { BaseController } from "./base-controller"; + + +export class ClassController extends BaseController { + constructor() { + super("class"); + } + + getAll(full = true) { + return this.get<{ classes: any[] }>(`/`, { full }); + } + + getById(id: string) { + return this.get<{ class: any }>(`/${id}`); + } + + createClass(data: any) { + return this.post<{ class: any }>(`/`, data); + } + + deleteClass(id: string) { + return this.delete<{ class: any }>(`/${id}`); + } + + + getStudents(id: string, full = true) { + return this.get<{ students: any[] }>(`/${id}/students`, { full }); + } + + getTeacherInvitations(id: string, full = true) { + return this.get<{ invitations: any[] }>(`/${id}/teacher-invitations`, { full }); + } +} \ No newline at end of file