From 9623d409d4f81423d816e455c2c0e854b94b95d1 Mon Sep 17 00:00:00 2001 From: Hannes Klinckaert Date: Thu, 3 Oct 2024 09:57:23 +0200 Subject: [PATCH] vingo: fix season filtering --- vingo/src/routes/seasons.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vingo/src/routes/seasons.rs b/vingo/src/routes/seasons.rs index d685b69..379d985 100644 --- a/vingo/src/routes/seasons.rs +++ b/vingo/src/routes/seasons.rs @@ -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::() .all(db)