From abe1b13f785d620274503cb4de4e44487ebecfa2 Mon Sep 17 00:00:00 2001 From: jj Date: Sun, 21 Jul 2024 00:59:44 +0900 Subject: [PATCH] =?UTF-8?q?Comment:=20findParentComment=EC=9D=98=20?= =?UTF-8?q?=EC=A3=BC=EC=84=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/leets/weeth/domain/post/service/CommentService.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/leets/weeth/domain/post/service/CommentService.java b/src/main/java/leets/weeth/domain/post/service/CommentService.java index 1906b6d7..de6b6ad3 100644 --- a/src/main/java/leets/weeth/domain/post/service/CommentService.java +++ b/src/main/java/leets/weeth/domain/post/service/CommentService.java @@ -92,10 +92,8 @@ public void delete(Long userId, Long commentId) throws InvalidAccessException { postRepository.save(currentPost); } - // 댓글의 부모를 찾는 메서드 + // 댓글의 부모 찾기 private Comment findParentComment(Long commentId) { - // 부모 댓글을 찾는 로직을 여기에 추가합니다. - // 예를 들어, 댓글의 자식 댓글을 모두 로드하여 부모를 찾을 수 있습니다. List allComments = commentRepository.findAll(); for (Comment comment : allComments) { if (comment.getChildren().stream().anyMatch(child -> child.getId().equals(commentId))) {