diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-07-31 21:04:13 +0200 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-07-31 21:04:13 +0200 |
commit | 15c1aa9d592acdc3c9c6feb710b1b116f1d78d89 (patch) | |
tree | ae24446ca1f3ea2569d2791c80dcace78238ee8d /planetwars-server/src/routes/matches.rs | |
parent | e8dbb019337287040891231701b7e50593c37187 (diff) | |
download | planetwars.dev-15c1aa9d592acdc3c9c6feb710b1b116f1d78d89.tar.xz planetwars.dev-15c1aa9d592acdc3c9c6feb710b1b116f1d78d89.zip |
add winner to match api responses
Diffstat (limited to 'planetwars-server/src/routes/matches.rs')
-rw-r--r-- | planetwars-server/src/routes/matches.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/planetwars-server/src/routes/matches.rs b/planetwars-server/src/routes/matches.rs index 0a4b56a..03f6653 100644 --- a/planetwars-server/src/routes/matches.rs +++ b/planetwars-server/src/routes/matches.rs @@ -14,6 +14,7 @@ pub struct ApiMatch { timestamp: chrono::NaiveDateTime, state: MatchState, players: Vec<ApiMatchPlayer>, + winner: Option<i32>, } #[derive(Serialize, Deserialize)] @@ -45,6 +46,7 @@ pub fn match_data_to_api(data: matches::FullMatchData) -> ApiMatch { bot_name: _p.bot.as_ref().map(|b| b.name.clone()), }) .collect(), + winner: data.base.winner, } } |