Sort playoff and group matches by position

This commit is contained in:
Thor77 2019-11-08 23:18:17 +01:00
parent 1720aa9bc2
commit 77f7b9b0f7
1 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ function convertTournament(apiTournament) {
function convertPlayoffStage(apiStage) {
return {
id: apiStage.id, level: apiStage.level, matches: apiStage.matches.map(match => convertMatch(match, false))
id: apiStage.id, level: apiStage.level, matches: apiStage.matches.sort((a, b) => a.position > b.position).map(match => convertMatch(match, false))
};
}
@ -81,7 +81,7 @@ function convertGroup(apiGroup) {
id: apiGroup.id,
number: apiGroup.number,
scores: apiGroup.group_scores,
matches: apiGroup.matches.map(match => convertMatch(match, true))
matches: apiGroup.matches.sort((a, b) => a.position > b.position).map(match => convertMatch(match, true))
};
}