From cf52ab6f7f4f96d552b2c6c828fc40704460046f Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Mon, 8 Aug 2022 18:31:11 +0200 Subject: implement before and after filters for matches --- planetwars-server/src/routes/matches.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'planetwars-server/src/routes') diff --git a/planetwars-server/src/routes/matches.rs b/planetwars-server/src/routes/matches.rs index c1957d4..1b7581c 100644 --- a/planetwars-server/src/routes/matches.rs +++ b/planetwars-server/src/routes/matches.rs @@ -35,7 +35,6 @@ pub struct ApiMatchPlayer { pub struct ListRecentMatchesParams { count: Option, // TODO: should timezone be specified here? - // TODO: implement these before: Option, after: Option, @@ -58,9 +57,9 @@ pub async fn list_recent_matches( Some(bot_name) => { let bot = db::bots::find_bot_by_name(&bot_name, &conn) .map_err(|_| StatusCode::BAD_REQUEST)?; - matches::list_bot_matches(bot.id, count, &conn) + matches::list_bot_matches(bot.id, count, params.before, params.after, &conn) } - None => matches::list_public_matches(count, &conn), + None => matches::list_public_matches(count, params.before, params.after, &conn), }; matches -- cgit v1.2.3