aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/routes/matches.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-08-08 18:31:11 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-08-08 18:31:11 +0200
commitcf52ab6f7f4f96d552b2c6c828fc40704460046f (patch)
tree4207929dfc4401979036252ee89744e780c393e4 /planetwars-server/src/routes/matches.rs
parentdb7980504f75371965fe887f2e459c8554ac09d0 (diff)
downloadplanetwars.dev-cf52ab6f7f4f96d552b2c6c828fc40704460046f.tar.xz
planetwars.dev-cf52ab6f7f4f96d552b2c6c828fc40704460046f.zip
implement before and after filters for matches
Diffstat (limited to 'planetwars-server/src/routes/matches.rs')
-rw-r--r--planetwars-server/src/routes/matches.rs5
1 files changed, 2 insertions, 3 deletions
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<usize>,
// TODO: should timezone be specified here?
- // TODO: implement these
before: Option<NaiveDateTime>,
after: Option<NaiveDateTime>,
@@ -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