feat: student query
This commit is contained in:
parent
c84964e719
commit
70d4c80093
5 changed files with 103 additions and 3 deletions
37
frontend/src/controllers/teachers.ts
Normal file
37
frontend/src/controllers/teachers.ts
Normal file
|
@ -0,0 +1,37 @@
|
|||
import { BaseController } from "@/controllers/base-controller.ts";
|
||||
|
||||
export class TeacherController extends BaseController {
|
||||
constructor() {
|
||||
super("teachers");
|
||||
}
|
||||
|
||||
getAll(full = false) {
|
||||
return this.get<{ teachers: any[] }>("/", { full });
|
||||
}
|
||||
|
||||
getByUsername(username: string) {
|
||||
return this.get<any>(`/${username}`);
|
||||
}
|
||||
|
||||
createTeacher(data: any) {
|
||||
return this.post<any>("/", data);
|
||||
}
|
||||
|
||||
deleteTeacher(username: string) {
|
||||
return this.delete<any>(`/${username}`);
|
||||
}
|
||||
|
||||
getClasses(username: string, full = false) {
|
||||
return this.get<any[]>(`/${username}/classes`, { full });
|
||||
}
|
||||
|
||||
getStudents(username: string, full = false) {
|
||||
return this.get<{ students: any[] }>(`/${username}/students`, { full });
|
||||
}
|
||||
|
||||
getQuestions(username: string, full = false) {
|
||||
return this.get<{ questions: any[] }>(`/${username}/questions`, { full });
|
||||
}
|
||||
|
||||
// GetInvitations(id: string) {return this.get<{ invitations: string[] }>(`/${id}/invitations`);}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue