Skip to content

Commit

Permalink
Merge pull request #86 from KUSITMS-27th-TEAM3/feat/user
Browse files Browse the repository at this point in the history
[fix] ๋Œ“๊ธ€ ์ˆ˜ ๋ฐ˜ํ™˜์‹œ ์‚ญ์ œ๋œ ๋Œ“๊ธ€๊นŒ์ง€ ํฌํ•จํ•ด์„œ ์นด์šดํŠธํ•˜๋Š” ์˜ค๋ฅ˜ ์ˆ˜์ •
  • Loading branch information
tlarbals824 authored May 24, 2023
2 parents 64611fc + a6aa880 commit f1dbcb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

public interface CommentRepository extends JpaRepository<Comment, Long> {

long countByAlbumId(Long albumId);

long countByAlbumIdAndDeletedFalse(Long albumId);
@Query("select c from Comment c where c.album.id = :albumId order by c.parent.id asc nulls first, c.createdDate asc")
Slice<Comment> findByAlbumId(Pageable pageable, @Param("albumId") Long albumId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public Slice<Comment> getCommentByAlbumId(Pageable pageable, Long albumId) {

@Cacheable(value = CachingStoreConst.COMMENT_COUNT_CACHE_NAME, key = "#albumId")
public long getCommentCountByAlbumId(Long albumId){
return commentRepository.countByAlbumId(albumId);
return commentRepository.countByAlbumIdAndDeletedFalse(albumId);
}

}

0 comments on commit f1dbcb5

Please sign in to comment.