diff --git a/src/main/java/com/software/ott/friend/repository/FriendRepository.java b/src/main/java/com/software/ott/friend/repository/FriendRepository.java index 7ec2527..552bc3e 100644 --- a/src/main/java/com/software/ott/friend/repository/FriendRepository.java +++ b/src/main/java/com/software/ott/friend/repository/FriendRepository.java @@ -11,5 +11,6 @@ @Repository public interface FriendRepository extends JpaRepository { List findAllByAccepterIdAndStatusOrRequesterIdAndStatus(Long accepterId, FriendStatus status1, Long requesterId, FriendStatus status2); + boolean existsByRequesterAndAccepter(Member requester, Member accepter); } diff --git a/src/main/java/com/software/ott/history/entity/ContentLike.java b/src/main/java/com/software/ott/history/entity/ContentLike.java index 8370b00..36cb865 100644 --- a/src/main/java/com/software/ott/history/entity/ContentLike.java +++ b/src/main/java/com/software/ott/history/entity/ContentLike.java @@ -30,8 +30,4 @@ public class ContentLike { @JoinColumn(name = "content_id") @OnDelete(action = OnDeleteAction.CASCADE) private Content content; - - public boolean memberIsNotCorrect(Member member) { - return !this.member.equals(member); - } } diff --git a/src/main/java/com/software/ott/history/service/ContentLikeService.java b/src/main/java/com/software/ott/history/service/ContentLikeService.java index e557bd4..d0f8d15 100644 --- a/src/main/java/com/software/ott/history/service/ContentLikeService.java +++ b/src/main/java/com/software/ott/history/service/ContentLikeService.java @@ -77,7 +77,7 @@ public List getTop10MostLikedContents() { @Transactional public void deleteContentLike(Long memberId, Long contentId) { ContentLike contentLike = contentLikeRepository.findByMemberIdAndContentId(memberId, contentId) - .orElseThrow(() -> new BadRequestException("선호도를 삭제할 권한이 없습니다.")); + .orElseThrow(() -> new BadRequestException("선호도를 삭제할 권한이 없습니다.")); contentLikeRepository.delete(contentLike); }