Merge branch 'fix-sort-matches-by-position' into 'master'
Fix sort matches by position See merge request turniere/turniere-frontend!37
This commit is contained in:
commit
c84bf12278
|
|
@ -72,7 +72,15 @@ function convertTournament(apiTournament) {
|
||||||
|
|
||||||
function convertPlayoffStage(apiStage) {
|
function convertPlayoffStage(apiStage) {
|
||||||
return {
|
return {
|
||||||
id: apiStage.id, level: apiStage.level, matches: apiStage.matches.sort((a, b) => a.position > b.position).map(match => convertMatch(match, false))
|
id: apiStage.id, level: apiStage.level, matches: apiStage.matches.sort((a, b) => {
|
||||||
|
if (a.position < b.position) {
|
||||||
|
return -1
|
||||||
|
} else if (a.position > b.position) {
|
||||||
|
return 1
|
||||||
|
} else {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
}).map(match => convertMatch(match, false))
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue