Skip to content

Commit

Permalink
[FIX]: 회원 탈퇴 시 탈퇴 회원이 작성한 게시글 스크랩 및 좋아요 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
phonil committed Aug 21, 2024
1 parent 516e543 commit 02c6692
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ public SuccessResponse<Message> exit(UserDetailsImpl userDetails) {
}
}
commentRepository.deleteAll(postCommentList);

List<Likes> postLikes = likesRepository.findByPost(post);
likesRepository.deleteAll(postLikes);

List<Scrap> postScraps = scrapRepository.findByPost(post);
scrapRepository.deleteAll(postScraps);
}

postRepository.deleteAll(postList);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ public interface LikesRepository extends JpaRepository<Likes, Long> {
List<Likes> findAllByMember(Member member);

void deleteByPost(Post post);

List<Likes> findByPost(Post post);
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ public interface ScrapRepository extends JpaRepository<Scrap, Long> {
List<Scrap> findAllByMember(Member member);

void deleteByPost(Post post);

List<Scrap> findByPost(Post post);
}

0 comments on commit 02c6692

Please sign in to comment.