feat: (frontend) queries teacher + test controller teacher

This commit is contained in:
Gabriellvl 2025-03-30 22:26:26 +02:00
parent 5e0f284131
commit 44c242fc57
11 changed files with 184 additions and 59 deletions

View file

@ -14,11 +14,11 @@ export class TeacherController extends BaseController {
}
createTeacher(data: any) {
return this.post<any>("/", data);
return this.post("/", data);
}
deleteTeacher(username: string) {
return this.delete<any>(`/${username}`);
return this.delete(`/${username}`);
}
getClasses(username: string, full = false) {
@ -33,5 +33,13 @@ export class TeacherController extends BaseController {
return this.get<{ questions: any[] }>(`/${username}/questions`, { full });
}
getStudentJoinRequests(username: string, classId: string){
return this.get<{ joinRequests: any[] }>(`/${username}/joinRequests/${classId}`);
}
updateStudentJoinRequest(teacherUsername: string, classId: string, studentUsername: string, accepted: boolean){
return this.put(`/${teacherUsername}/joinRequests/${classId}/${studentUsername}`, accepted)
}
// GetInvitations(id: string) {return this.get<{ invitations: string[] }>(`/${id}/invitations`);}
}