From e8dbb019337287040891231701b7e50593c37187 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Sat, 30 Jul 2022 19:49:08 +0200 Subject: list only public matches in API --- planetwars-server/src/routes/matches.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'planetwars-server/src/routes') diff --git a/planetwars-server/src/routes/matches.rs b/planetwars-server/src/routes/matches.rs index 58ca478..0a4b56a 100644 --- a/planetwars-server/src/routes/matches.rs +++ b/planetwars-server/src/routes/matches.rs @@ -23,8 +23,10 @@ pub struct ApiMatchPlayer { bot_name: Option, } -pub async fn list_matches(conn: DatabaseConnection) -> Result>, StatusCode> { - matches::list_matches(100, &conn) +pub async fn list_public_matches( + conn: DatabaseConnection, +) -> Result>, StatusCode> { + matches::list_public_matches(100, &conn) .map_err(|_| StatusCode::BAD_REQUEST) .map(|matches| Json(matches.into_iter().map(match_data_to_api).collect())) } -- cgit v1.2.3