Skip to content

Commit

Permalink
fix (#3) : 댓글 조회시 DailyPlan 조회 쿼리 틀린 변수명 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
daehwan2yo committed Apr 11, 2022
1 parent c1c3bd5 commit 3790891
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 @@ -30,7 +30,7 @@ public List<Comment> getCommentsByAccountIdAndDate(Long accountId, LocalDate dat
@Transactional
public void saveComment(Long accountId, LocalDate localDate, Comment comment) {
DailyPlan dailyPlan = dailyPlanRepository.findByAccountIdAndDate(accountId, localDate)
.orElseThrow();
.orElseThrow(() -> new IllegalArgumentException("account or date not found"));
dailyPlan.addComment(comment);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@

public interface DailyPlanRepository extends JpaRepository<DailyPlan, Long> {
@Query("select dp from DailyPlan dp where dp.account.id=:accountId and dp.date=:date")
Optional<DailyPlan> findByAccountIdAndDate(@Param("accountId") long accountId, @Param("date") LocalDate localDate);
Optional<DailyPlan> findByAccountIdAndDate(Long accountId, LocalDate date);
}

0 comments on commit 3790891

Please sign in to comment.