feat: frontend group controller geimplementeerd
This commit is contained in:
parent
dbc3b2b0b6
commit
4b82455eb9
2 changed files with 33 additions and 1 deletions
32
frontend/src/controllers/groups.ts
Normal file
32
frontend/src/controllers/groups.ts
Normal file
|
@ -0,0 +1,32 @@
|
|||
import { BaseController } from "./base-controller";
|
||||
|
||||
export class GroupController extends BaseController {
|
||||
constructor(classid: string, assignmentNumber: number) {
|
||||
super(`class/${classid}/assignments/${assignmentNumber}/groups`);
|
||||
}
|
||||
|
||||
getAll(full = true) {
|
||||
return this.get<{ groups: any[] }>(`/`, { full });
|
||||
}
|
||||
|
||||
getByNumber(num: number) {
|
||||
return this.get<{ group: any }>(`/${num}`);
|
||||
}
|
||||
|
||||
createGroup(data: any) {
|
||||
return this.post<{ group: any }>(`/`, data);
|
||||
}
|
||||
|
||||
deleteClass(num: number) {
|
||||
return this.delete<{ group: any }>(`/${num}`);
|
||||
}
|
||||
|
||||
|
||||
getSubmissions(groupNumber: number, full = true) {
|
||||
return this.get<{ groups: any[] }>(`/${groupNumber}/submissions`, { full });
|
||||
}
|
||||
|
||||
getQuestions(groupNumber: number, full = true) {
|
||||
return this.get<{ questions: any[] }>(`/${groupNumber}/questions`, { full });
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue