Skip to content

Commit

Permalink
vingo: fix season filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
hannes-dev committed Oct 3, 2024
1 parent c13429a commit 9623d40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vingo/src/routes/seasons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ pub async fn db_seasons(db: &DatabaseConnection, future: bool) -> ResponseResult
.and(Expr::col(season::Column::Id).ne(1)),
"is_current",
)
.apply_if(future.then_some(()), |query, _| {
query.filter(Expr::col(season::Column::Start).gt(Expr::current_date()))
.apply_if((!future).then_some(()), |query, _| {
query.filter(Expr::col(season::Column::Start).lt(Expr::current_date()))
})
.into_model::<SeasonGet>()
.all(db)
Expand Down

0 comments on commit 9623d40

Please sign in to comment.