Fix results POST and GET #5
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 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
|
let score_data: Vec<CompetitionRankingScoreData> = results
|
||||||
.iter()
|
.iter()
|
||||||
|
|
@ -676,7 +682,7 @@ impl Ranking for User {
|
||||||
fest_id,
|
fest_id,
|
||||||
score_data,
|
score_data,
|
||||||
unk: 0,
|
unk: 0,
|
||||||
team_wins: results.iter().map(|r| r.team_win as u32).collect(),
|
team_wins: wins,
|
||||||
team_votes,
|
team_votes,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue