Skip to content

Commit

Permalink
refactor : ν† νƒˆ cnt fix
Browse files Browse the repository at this point in the history
  • Loading branch information
μž„ν˜„μš° committed Sep 3, 2024
1 parent 44ebb54 commit aed4909
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,13 @@ public Page<TastingNote> findTastingNotesByWine(Wine wine, User user, Integer pa
.limit(pageable.getPageSize())
.fetch();

long total = queryFactory.selectFrom(qTastingNote).fetchCount();
long total = queryFactory.selectFrom(qTastingNote).where(
qTastingNote.wine.eq(wine)
.and(qTastingNote.isDeleted.eq(false))
.and(qTastingNote.isPublic.eq(true)
.or(qTastingNote.user.eq(user))
)
).fetchCount();

return new PageImpl<>(results, pageable, total);
}
Expand Down

0 comments on commit aed4909

Please sign in to comment.