From 49a5735e07e7868195590a13c247698aaa1c5358 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Sat, 27 Aug 2022 17:41:32 +0200 Subject: show map info for matches --- planetwars-server/src/routes/matches.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'planetwars-server/src/routes/matches.rs') diff --git a/planetwars-server/src/routes/matches.rs b/planetwars-server/src/routes/matches.rs index 71c4409..10b4507 100644 --- a/planetwars-server/src/routes/matches.rs +++ b/planetwars-server/src/routes/matches.rs @@ -15,6 +15,8 @@ use crate::{ DatabaseConnection, GlobalConfig, }; +use super::maps::ApiMap; + #[derive(Serialize, Deserialize)] pub struct ApiMatch { id: i32, @@ -22,6 +24,7 @@ pub struct ApiMatch { state: MatchState, players: Vec, winner: Option, + map: Option, } #[derive(Serialize, Deserialize)] @@ -102,6 +105,7 @@ pub fn match_data_to_api(data: matches::FullMatchData) -> ApiMatch { }) .collect(), winner: data.base.winner, + map: data.map.map(|m| ApiMap { name: m.name }), } } -- cgit v1.2.3