Skip to content

Commit

Permalink
Hotfix | #81 | @YongsHub | v1.0.1 출시 위해 Calendar nullable 쿼리 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
YongsHub authored Mar 2, 2024
1 parent a098091 commit 74c0134
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ class CalendarQueryRepository(

private fun eqUserId(userId: Long?): BooleanExpression = calendar.user.id.eq(userId)

private fun eqYearAndMonth(param: CalenderListRequestParam): BooleanExpression {
private fun eqYearAndMonth(param: CalenderListRequestParam): BooleanExpression? {
if (param.year == null && param.month == null) {
return null
} else if (param.month == null) {
return calendar.startDate.year().eq(param.year)
} else if (param.year == null) {
return calendar.startDate.month().eq(param.month)
}
return calendar.startDate.year().eq(param.year).and(calendar.startDate.month().eq(param.month))
}
}

0 comments on commit 74c0134

Please sign in to comment.