From b4151cf7dc9700346bfda789ae7589fe654b715c Mon Sep 17 00:00:00 2001 From: 5jisoo <56earls@gmail.com> Date: Wed, 23 Aug 2023 13:41:19 +0900 Subject: [PATCH] #7 fix: set status INACTIVE --- .../java/com/umc/place/comment/service/CommentService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/place/src/main/java/com/umc/place/comment/service/CommentService.java b/place/src/main/java/com/umc/place/comment/service/CommentService.java index 786e82c..c6c2da5 100644 --- a/place/src/main/java/com/umc/place/comment/service/CommentService.java +++ b/place/src/main/java/com/umc/place/comment/service/CommentService.java @@ -14,6 +14,7 @@ import org.springframework.transaction.annotation.Transactional; import static com.umc.place.common.BaseResponseStatus.*; +import static com.umc.place.common.Constant.INACTIVE; @Service @RequiredArgsConstructor @@ -55,7 +56,7 @@ public Void deleteComment(Long storyIdx, Long commentIdx, Long ownerIdx) throws throw new BaseException(NOT_OWNER); } - commentRepository.delete(comment); + comment.setStatus(INACTIVE); story.getComments().remove(comment); // 양방향 연관관계 return null;