Skip to content

Commit

Permalink
bugfix(#325): modify entity's field name in query
Browse files Browse the repository at this point in the history
  • Loading branch information
hobiJeong committed Mar 8, 2024
1 parent 9bbdc6e commit 1da660f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mentors/repositories/mentor.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit 1da660f

Please sign in to comment.