Skip to content

Commit

Permalink
Merge branch 'dev' into test
Browse files Browse the repository at this point in the history
  • Loading branch information
gouyeonch committed Sep 9, 2024
2 parents c388fbe + e3ec54b commit ba1f195
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public interface NewsReactionRepository extends JpaRepository<NewsReaction, Long> {
Long countByNewsIdAndReaction(Long newsId, ENewsReaction reaction);

Boolean existsByNewsIdAndUserIdAndReaction(Long newsId, Long userId, ENewsReaction reaction);
Boolean existsByNewsIdAndUserId(Long newsId, Long userId);

void deleteByNewsAndUserAndReaction(News news, User user, ENewsReaction reaction);
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public NewsReactionDto createNewsReaction(Long userId, CreateNewsReactionDto cre

News news = newsLookupService.findNewsById(createNewsReactionDto.newsId());

if (newsReactionRepository.existsByNewsIdAndUserIdAndReaction(news.getId(), user.getId(), createNewsReactionDto.reaction())) {
if (newsReactionRepository.existsByNewsIdAndUserId(news.getId(), user.getId())) {
throw new CommonException(ErrorCode.DUPLICATED_NEWS_REACTION);
}

Expand Down

0 comments on commit ba1f195

Please sign in to comment.