diff --git a/src/main/java/leets/weeth/domain/comment/application/usecase/NoticeCommentUsecaseImpl.java b/src/main/java/leets/weeth/domain/comment/application/usecase/NoticeCommentUsecaseImpl.java index 43c5f4c6..dd9e6570 100644 --- a/src/main/java/leets/weeth/domain/comment/application/usecase/NoticeCommentUsecaseImpl.java +++ b/src/main/java/leets/weeth/domain/comment/application/usecase/NoticeCommentUsecaseImpl.java @@ -90,6 +90,9 @@ public void deleteNoticeComment(Long commentId, Long userId) throws UserNotMatch Comment comment = validateOwner(commentId, userId); Notice notice = comment.getNotice(); + List fileList = getFiles(commentId); + fileDeleteService.delete(fileList); + if (comment.getChildren().isEmpty()) { Comment parentComment = findParentComment(commentId); commentDeleteService.delete(commentId); diff --git a/src/main/java/leets/weeth/domain/comment/application/usecase/PostCommentUsecaseImpl.java b/src/main/java/leets/weeth/domain/comment/application/usecase/PostCommentUsecaseImpl.java index c2b65549..2535c8ab 100644 --- a/src/main/java/leets/weeth/domain/comment/application/usecase/PostCommentUsecaseImpl.java +++ b/src/main/java/leets/weeth/domain/comment/application/usecase/PostCommentUsecaseImpl.java @@ -92,6 +92,9 @@ public void deletePostComment(Long commentId, Long userId) throws UserNotMatchEx Comment comment = validateOwner(commentId, userId); Post post = comment.getPost(); + List fileList = getFiles(commentId); + fileDeleteService.delete(fileList); + /* 1. 지우고자 하는 댓글이 맨 아래층인 경우(child, child가 없는 댓글 - 현재 댓글.getChildren이 NULL 이면 해당