Skip to content

Commit

Permalink
refactor: 리팩터링
Browse files Browse the repository at this point in the history
  • Loading branch information
GitJIHO committed Nov 27, 2024
1 parent d573bcb commit 4a3a59c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
@Repository
public interface FriendRepository extends JpaRepository<Friend, Long> {
List<Friend> findAllByAccepterIdAndStatusOrRequesterIdAndStatus(Long accepterId, FriendStatus status1, Long requesterId, FriendStatus status2);

boolean existsByRequesterAndAccepter(Member requester, Member accepter);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public List<TopContentLikeResponse> getTop10MostLikedContents() {
@Transactional
public void deleteContentLike(Long memberId, Long contentId) {
ContentLike contentLike = contentLikeRepository.findByMemberIdAndContentId(memberId, contentId)
.orElseThrow(() -> new BadRequestException("선호도를 삭제할 권한이 없습니다."));
.orElseThrow(() -> new BadRequestException("선호도를 삭제할 권한이 없습니다."));

contentLikeRepository.delete(contentLike);
}
Expand Down

0 comments on commit 4a3a59c

Please sign in to comment.