aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/routes
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-07-30 19:49:08 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-07-30 19:49:08 +0200
commite8dbb019337287040891231701b7e50593c37187 (patch)
tree13729b8d11389ff9aaa2d356cd0d784ca94517b3 /planetwars-server/src/routes
parentee5c67c092acc57a6ef2b8f7934ba827df43add6 (diff)
downloadplanetwars.dev-e8dbb019337287040891231701b7e50593c37187.tar.xz
planetwars.dev-e8dbb019337287040891231701b7e50593c37187.zip
list only public matches in API
Diffstat (limited to 'planetwars-server/src/routes')
-rw-r--r--planetwars-server/src/routes/matches.rs6
1 files changed, 4 insertions, 2 deletions
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<String>,
}
-pub async fn list_matches(conn: DatabaseConnection) -> Result<Json<Vec<ApiMatch>>, StatusCode> {
- matches::list_matches(100, &conn)
+pub async fn list_public_matches(
+ conn: DatabaseConnection,
+) -> Result<Json<Vec<ApiMatch>>, StatusCode> {
+ matches::list_public_matches(100, &conn)
.map_err(|_| StatusCode::BAD_REQUEST)
.map(|matches| Json(matches.into_iter().map(match_data_to_api).collect()))
}