diff --git a/src/mentors/repositories/mentor.repository.ts b/src/mentors/repositories/mentor.repository.ts index 8dfd1c8e..9180a5bb 100644 --- a/src/mentors/repositories/mentor.repository.ts +++ b/src/mentors/repositories/mentor.repository.ts @@ -33,16 +33,16 @@ export class MentorRepository { .createQueryBuilder('user') .innerJoin('user.userImage', 'userImage') .innerJoin('user.userIntro', 'userIntro') - .leftJoin('user.mentor', 'mentor') - .leftJoin('user.mentorBoard', 'mentorBoard') + .leftJoin('user.reviewed', 'reviewed') + .leftJoin('user.mentorBoards', 'mentorBoards') .select([ 'user.id as id', 'user.name as name', 'user.rank as user_rank', 'JSON_OBJECT("imageUrl", userImage.imageUrl) as userImage', 'JSON_OBJECT("shortIntro", userIntro.shortIntro, "customCategory", userIntro.customCategory) as userIntro', - 'COUNT(DISTINCT mentor.id) as mentorReviewCount', - 'COUNT(DISTINCT mentorBoard.id) as mentorBoardCount', + 'COUNT(DISTINCT reviewed.id) as mentorReviewCount', + 'COUNT(DISTINCT mentorBoards.id) as mentorBoardCount', ]) .where('user.isMentor = true');