From 02c66929b0ff3370b22956d24fda7a72027cc0c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=8A=B9=EC=9A=B0?= Date: Wed, 21 Aug 2024 20:04:45 +0900 Subject: [PATCH] =?UTF-8?q?[FIX]:=20=ED=9A=8C=EC=9B=90=20=ED=83=88?= =?UTF-8?q?=ED=87=B4=20=EC=8B=9C=20=ED=83=88=ED=87=B4=20=ED=9A=8C=EC=9B=90?= =?UTF-8?q?=EC=9D=B4=20=EC=9E=91=EC=84=B1=ED=95=9C=20=EA=B2=8C=EC=8B=9C?= =?UTF-8?q?=EA=B8=80=20=EC=8A=A4=ED=81=AC=EB=9E=A9=20=EB=B0=8F=20=EC=A2=8B?= =?UTF-8?q?=EC=95=84=EC=9A=94=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mvp/deplog/domain/auth/application/AuthServiceImpl.java | 6 ++++++ .../domain/likes/domain/repository/LikesRepository.java | 2 ++ .../domain/scrap/domain/repository/ScrapRepository.java | 2 ++ 3 files changed, 10 insertions(+) diff --git a/src/main/java/mvp/deplog/domain/auth/application/AuthServiceImpl.java b/src/main/java/mvp/deplog/domain/auth/application/AuthServiceImpl.java index 9ea7139..e04a596 100644 --- a/src/main/java/mvp/deplog/domain/auth/application/AuthServiceImpl.java +++ b/src/main/java/mvp/deplog/domain/auth/application/AuthServiceImpl.java @@ -200,6 +200,12 @@ public SuccessResponse exit(UserDetailsImpl userDetails) { } } commentRepository.deleteAll(postCommentList); + + List postLikes = likesRepository.findByPost(post); + likesRepository.deleteAll(postLikes); + + List postScraps = scrapRepository.findByPost(post); + scrapRepository.deleteAll(postScraps); } postRepository.deleteAll(postList); diff --git a/src/main/java/mvp/deplog/domain/likes/domain/repository/LikesRepository.java b/src/main/java/mvp/deplog/domain/likes/domain/repository/LikesRepository.java index 690cb06..d76c02e 100644 --- a/src/main/java/mvp/deplog/domain/likes/domain/repository/LikesRepository.java +++ b/src/main/java/mvp/deplog/domain/likes/domain/repository/LikesRepository.java @@ -17,4 +17,6 @@ public interface LikesRepository extends JpaRepository { List findAllByMember(Member member); void deleteByPost(Post post); + + List findByPost(Post post); } diff --git a/src/main/java/mvp/deplog/domain/scrap/domain/repository/ScrapRepository.java b/src/main/java/mvp/deplog/domain/scrap/domain/repository/ScrapRepository.java index b9f4e0d..150c9e7 100644 --- a/src/main/java/mvp/deplog/domain/scrap/domain/repository/ScrapRepository.java +++ b/src/main/java/mvp/deplog/domain/scrap/domain/repository/ScrapRepository.java @@ -21,4 +21,6 @@ public interface ScrapRepository extends JpaRepository { List findAllByMember(Member member); void deleteByPost(Post post); + + List findByPost(Post post); }