Skip to content

Commit

Permalink
Merge pull request #241 from haedoang/feature/contact
Browse files Browse the repository at this point in the history
 [feature/contact] 좋아요 쿼리 오류 수정
  • Loading branch information
haedoang authored Nov 5, 2023
2 parents bb9c64c + 4847a8a commit 27faced
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 @@ -137,7 +137,7 @@ public void likeRoom(Long roomId, User user) {
Room room = getRoom(roomId);
final Like like = Like.of(room, user);

likeRepository.findByRoomId(roomId)
likeRepository.findByRoomIdAndUserId(roomId, user.getId())
.ifPresentOrElse(
likeRepository::delete,
() -> likeRepository.save(like)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
*/
public interface LikeRepository extends JpaRepository<Like, Long> {

Optional<Like> findByRoomId(Long roomId);
Optional<Like> findByRoomIdAndUserId(Long roomId, Long userId);
}

0 comments on commit 27faced

Please sign in to comment.