Skip to content

Commit

Permalink
refactor: remove old mentors routes (#2458)
Browse files Browse the repository at this point in the history
  • Loading branch information
valerydluski authored Apr 11, 2024
1 parent e4cff04 commit b5f6767
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 137 deletions.
6 changes: 0 additions & 6 deletions server/src/routes/course/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
postMentor,
restoreExpelledMentor,
} from './mentor';
import * as mentors from './mentors';
import * as score from './score';
import * as stageInterview from './stageInterview';
import {
Expand Down Expand Up @@ -150,11 +149,6 @@ function addStageInterviewApi(router: Router<any, any>, logger: ILogger) {
function addMentorApi(router: Router<any, any>, logger: ILogger) {
const validators = [validateGithubIdAndAccess];

const mentorsLogger = logger.child({ module: 'course/mentors' });
router.get('/mentors', courseSupervisorGuard, mentors.getMentors(mentorsLogger));
router.post('/mentors', adminGuard, mentors.createMentors(mentorsLogger));
router.post('/mentors/students', courseSupervisorGuard, mentors.assignStudents(mentorsLogger));

const mentorLogger = logger.child({ module: 'course/mentor' });
router.post('/mentor/:githubId', guard, ...validators, postMentor(mentorLogger));
router.post('/repositories/mentor/:githubId', courseManagerGuard, ...validators, inviteMentorToTeam(mentorLogger));
Expand Down
14 changes: 0 additions & 14 deletions server/src/routes/course/mentors/assignStudents.ts

This file was deleted.

20 changes: 0 additions & 20 deletions server/src/routes/course/mentors/createMentors.ts

This file was deleted.

11 changes: 0 additions & 11 deletions server/src/routes/course/mentors/getMentors.ts

This file was deleted.

3 changes: 0 additions & 3 deletions server/src/routes/course/mentors/index.ts

This file was deleted.

16 changes: 0 additions & 16 deletions server/src/services/course.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,22 +316,6 @@ export async function getCrossStudentsByMentor(courseId: number, githubId: strin
return students;
}

export async function getMentors(courseId: number): Promise<MentorDetails[]> {
const records = await mentorQuery()
.innerJoin('mentor.user', 'user')
.addSelect(getPrimaryUserFields())
.innerJoin('mentor.course', 'course')
.leftJoin('mentor.students', 'students')
.addSelect(['students.id'])
.leftJoinAndSelect('mentor.stageInterviews', 'stageInterviews')
.where(`course.id = :courseId`, { courseId })
.orderBy('mentor.createdDate')
.getMany();

const mentors = records.map(convertToMentorDetails);
return mentors;
}

export async function getMentorsWithStudents(courseId: number): Promise<MentorDetails[]> {
const records = await mentorQuery()
.innerJoin('mentor.user', 'user')
Expand Down
67 changes: 0 additions & 67 deletions server/src/services/mentor.service.ts

This file was deleted.

0 comments on commit b5f6767

Please sign in to comment.