Skip to content

Commit

Permalink
fix: 동네생활 좋아요 오류 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
nohy6630 committed Apr 15, 2024
1 parent 0288fdd commit 826c2ee
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ public Integer decreaseArticleLike(Long articleId) {

// 사용자의 게시글 좋아요 목록에서 제거
List<ArticleLike> articleLikeList = articleLikeRepository.findByMember(member);
articleLikeList.removeIf(articleLike -> articleLike.getArticleId().equals(articleId));
articleLikeList.forEach(articleLike -> {
if (articleLike.getArticleId().equals(articleId))
articleLikeRepository.delete(articleLike);
});

return article.getLikeCount();
}
Expand All @@ -108,7 +111,6 @@ public Integer increaseCommentLike(Long commentId) {
commentLikeRepository.save(new CommentLike(member, commentEntity));



Long ownerId = commentEntity.getAuthorId();
Member owner = memberRepository.findById(ownerId)
.orElseThrow(NotFoundMemberException::new);
Expand Down

0 comments on commit 826c2ee

Please sign in to comment.