Skip to content

Commit

Permalink
:refactor: comment가 null인 Review는 조회하지 않도록 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
na-yk committed Nov 22, 2023
1 parent 25fd202 commit ed2b92a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public List<String> getPublicCommentsByRevieweeUser(User user) {
return jpaQueryFactory.select(review.comment)
.from(review)
.where(revieweeEqualsUser(user),
review.comment.isNotNull(),
isPublic())
.orderBy(review.createdAt.desc())
.fetch();
Expand All @@ -37,9 +38,10 @@ public List<String> getPublicCommentsByRevieweeUser(User user) {
@Override
public List<ReviewsBySteadyResponse> getAllReviewsByRevieweeUser(User user) {
return jpaQueryFactory.selectFrom(steady)
.leftJoin(review)
.innerJoin(review)
.on(steady.id.eq(review.steady.id))
.where(revieweeEqualsUser(user))
.where(revieweeEqualsUser(user),
review.comment.isNotNull())
.orderBy(steady.finishedAt.desc())
.transform(groupBy(steady.id)
.list(Projections.constructor(
Expand Down

0 comments on commit ed2b92a

Please sign in to comment.