feat: frontend klas controller aangemaakt

This commit is contained in:
Adriaan Jacquet 2025-03-30 17:38:32 +02:00
parent c6aea229f0
commit eb8ac9c3bb

View file

@ -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 });
}
}