feat: get teachers van class
This commit is contained in:
parent
29824c549e
commit
db3c531038
2 changed files with 8 additions and 1 deletions
|
@ -3,7 +3,7 @@ import {
|
||||||
createClassHandler,
|
createClassHandler,
|
||||||
getAllClassesHandler,
|
getAllClassesHandler,
|
||||||
getClassHandler,
|
getClassHandler,
|
||||||
getClassStudentsHandler,
|
getClassStudentsHandler, getClassTeachersHandler,
|
||||||
getTeacherInvitationsHandler,
|
getTeacherInvitationsHandler,
|
||||||
} from '../controllers/classes.js';
|
} from '../controllers/classes.js';
|
||||||
import assignmentRouter from './assignments.js';
|
import assignmentRouter from './assignments.js';
|
||||||
|
@ -22,6 +22,8 @@ router.get('/:id/teacher-invitations', getTeacherInvitationsHandler);
|
||||||
|
|
||||||
router.get('/:id/students', getClassStudentsHandler);
|
router.get('/:id/students', getClassStudentsHandler);
|
||||||
|
|
||||||
|
router.get('/:id/teachers', getClassTeachersHandler);
|
||||||
|
|
||||||
router.use('/:classid/assignments', assignmentRouter);
|
router.use('/:classid/assignments', assignmentRouter);
|
||||||
|
|
||||||
export default router;
|
export default router;
|
||||||
|
|
|
@ -3,6 +3,7 @@ import type { ClassDTO } from "@dwengo-1/common/interfaces/class";
|
||||||
import type { StudentsResponse } from "./students";
|
import type { StudentsResponse } from "./students";
|
||||||
import type { AssignmentsResponse } from "./assignments";
|
import type { AssignmentsResponse } from "./assignments";
|
||||||
import type { TeacherInvitationDTO } from "@dwengo-1/common/interfaces/teacher-invitation";
|
import type { TeacherInvitationDTO } from "@dwengo-1/common/interfaces/teacher-invitation";
|
||||||
|
import type {TeachersResponse} from "@/controllers/teachers.ts";
|
||||||
|
|
||||||
export interface ClassesResponse {
|
export interface ClassesResponse {
|
||||||
classes: ClassDTO[] | string[];
|
classes: ClassDTO[] | string[];
|
||||||
|
@ -45,6 +46,10 @@ export class ClassController extends BaseController {
|
||||||
return this.get<StudentsResponse>(`/${id}/students`, { full });
|
return this.get<StudentsResponse>(`/${id}/students`, { full });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getTeachers(id: string, full = true): Promise<TeachersResponse> {
|
||||||
|
return this.get<TeachersResponse>(`/${id}/teachers`, { full });
|
||||||
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
async getTeacherInvitations(id: string, full = true): Promise<TeacherInvitationsResponse> {
|
async getTeacherInvitations(id: string, full = true): Promise<TeacherInvitationsResponse> {
|
||||||
return this.get<TeacherInvitationsResponse>(`/${id}/teacher-invitations`, { full });
|
return this.get<TeacherInvitationsResponse>(`/${id}/teacher-invitations`, { full });
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue