affichage tournoi après poules

This commit is contained in:
Allan Cueff
2023-11-07 19:53:58 +01:00
parent 1a9cde159e
commit 90acf19b1d

View File

@@ -4,7 +4,7 @@ import pb from './login.js'
const SportList = await pb.collection('sport').getFullList({}); const SportList = await pb.collection('sport').getFullList({});
const EquipeList = await pb.collection('equipes').getFullList({ const EquipeList = await pb.collection('equipes').getFullList({
expand: 'promo', expand: 'promo,sport',
}); });
const matchList = await pb.collection('match').getFullList({ const matchList = await pb.collection('match').getFullList({
@@ -35,7 +35,7 @@ function getOrderedTableTeams(sport){
} }
return result return result
} else if (sport.type === "tournois"){ } else if (sport.type === "tournois"){
let teams = EquipeList.filter(equipe => equipe.sport === sport.id).sort((teamA, teamB) => parseInt(teamA.stade, 10) - parseInt(teamB.stade, 10)) let teams = EquipeList.filter(equipe => equipe.expand.sport.name === sport.name && equipe.stade !== '').sort((teamA, teamB) => parseInt(teamA.stade, 10) - parseInt(teamB.stade, 10))
for(let i = 0; i < teams.length; i++){ for(let i = 0; i < teams.length; i++){
let stade; let stade;
switch(teams[i].stade){ switch(teams[i].stade){