Skip to content

Commit

Permalink
Merge pull request #571 from traPtitech/fix/event-date-filter
Browse files Browse the repository at this point in the history
fix:eventの取得ロジックの時間フィルタを変更
  • Loading branch information
iChemy authored Nov 9, 2024
2 parents 44e0642 + 3ba23d4 commit 3d028b2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions router/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,15 @@ func (h *Handlers) HandleGetEvents(c echo.Context) error {
if err != nil {
return badRequest(err, message("invalid time"))
}
events, err := h.Repo.GetEvents(
filter.AddAnd(expr, filter.FilterTime(start, end)),
getConinfo(c))

durationExpr, err := filter.FilterDuration(start, end)
if err != nil {
return badRequest(err, message("filter duration error"))
}

combinedExpr := filter.AddAnd(expr, durationExpr)

events, err := h.Repo.GetEvents(combinedExpr, getConinfo(c))
if err != nil {
return judgeErrorResponse(err)
}
Expand Down

0 comments on commit 3d028b2

Please sign in to comment.