Merge branch 'v0' into 'v0'
Fix results POST and GET See merge request spfn/rust-nex!5
This commit is contained in:
commit
ec3477afaa
1 changed files with 8 additions and 2 deletions
|
|
@ -659,6 +659,12 @@ impl Ranking for User {
|
|||
};
|
||||
|
||||
let team_votes = fetch_team_votes(fest_id)?;
|
||||
let mut wins = vec![0u32, 0u32];
|
||||
for r in &results {
|
||||
if r.team_win == 1 && (r.team_id == 0 || r.team_id == 1) {
|
||||
wins[r.team_id as usize] += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let score_data: Vec<CompetitionRankingScoreData> = results
|
||||
.iter()
|
||||
|
|
@ -671,12 +677,12 @@ impl Ranking for User {
|
|||
appdata: QBuffer(vec![]),
|
||||
})
|
||||
.collect();
|
||||
|
||||
|
||||
let info = CompetitionRankingScoreInfo {
|
||||
fest_id,
|
||||
score_data,
|
||||
unk: 0,
|
||||
team_wins: results.iter().map(|r| r.team_win as u32).collect(),
|
||||
team_wins: wins,
|
||||
team_votes,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue