feat: (frontend) queries teacher + test controller teacher
This commit is contained in:
parent
5e0f284131
commit
44c242fc57
11 changed files with 184 additions and 59 deletions
|
@ -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`);}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue