Fix results POST and GET #5

Merged
redbinder0526 merged 2 commits from v0 into v0 2026-04-12 21:32:53 +02:00

View file

@ -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()
@ -676,7 +682,7 @@ impl Ranking for User {
fest_id,
score_data,
unk: 0,
team_wins: results.iter().map(|r| r.team_win as u32).collect(),
team_wins: wins,
team_votes,
};