Skip to content

Commit

Permalink
[COZY-223] fix : 댓글 desc 삭제 (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
veronees authored Aug 29, 2024
1 parent 759240f commit bb77de5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public PostDetailDTO getPost(Member member, Long roomId, Long postId) {
}
List<PostImage> imageList = postImageRepository.findByPostId(postId);

List<PostComment> postComments = postCommentRepository.findByPostIdOrderByCreatedAtDesc(postId);
List<PostComment> postComments = postCommentRepository.findByPostIdOrderByCreatedAt(postId);

// Local 변수 reassign 하기 싫어서 삼항 연산자 사용

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public interface PostCommentRepository extends JpaRepository<PostComment, Long>

Integer countByPostId(Long postId);

List<PostComment> findByPostIdOrderByCreatedAtDesc(Long postId);
List<PostComment> findByPostIdOrderByCreatedAt(Long postId);

void deleteAllByPostId(Long postId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public List<PostCommentViewDTO> getPostCommentList(Member member, Long roomId, L
throw new GeneralException(ErrorStatus._POST_NOT_FOUND);
}

List<PostComment> postComments = postCommentRepository.findByPostIdOrderByCreatedAtDesc(
List<PostComment> postComments = postCommentRepository.findByPostIdOrderByCreatedAt(
postId);

return postComments.stream()
Expand Down

0 comments on commit bb77de5

Please sign in to comment.