add winner to match api responses
This commit is contained in:
parent
e8dbb01933
commit
15c1aa9d59
1 changed files with 2 additions and 0 deletions
|
@ -14,6 +14,7 @@ pub struct ApiMatch {
|
||||||
timestamp: chrono::NaiveDateTime,
|
timestamp: chrono::NaiveDateTime,
|
||||||
state: MatchState,
|
state: MatchState,
|
||||||
players: Vec<ApiMatchPlayer>,
|
players: Vec<ApiMatchPlayer>,
|
||||||
|
winner: Option<i32>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[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()),
|
bot_name: _p.bot.as_ref().map(|b| b.name.clone()),
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
|
winner: data.base.winner,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue