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