diff --git a/index.html b/index.html index 20c4eca..c704e49 100644 --- a/index.html +++ b/index.html @@ -518,9 +518,11 @@ headers: { "Authorization": `Bearer ${storedApiKey}` } }) .then(response => response.json()) - .then(data => { - const sortedPlayers = data.convocation.available - .sort((a, b) => (a.number || 0) - (b.number || 0)); + .then(data => { + // Check if available players data exists + const availablePlayers = data.convocation.available || []; + const sortedPlayers = availablePlayers + .sort((a, b) => (a.number || 0) - (b.number || 0)); // Calculate player statistics const totalPlayers = sortedPlayers.length; @@ -551,19 +553,73 @@ return numA - numB; }); - eventDetailsContent.innerHTML = ` -
Type: ${data.type}
-Lieu: ${data.place}
-Heure: ${data.time_start} - ${data.time_end}
-Joueurs convoqués: ${totalPlayers} joueur${totalPlayers > 1 ? 's' : ''} (${positionBreakdown})
-Type: ${data.type}
+Lieu: ${data.place}
+Heure: ${data.time_start} - ${data.time_end}
+Il n'y a actuellement aucun joueur ni personnel convoqué pour ce match.
+Il n'y a actuellement aucun personnel convoqué pour ce match.
+Type: ${data.type}
+Lieu: ${data.place}
+Heure: ${data.time_start} - ${data.time_end}
+Il n'y a actuellement aucun joueur convoqué pour ce match.
+Type: ${data.type}
+Lieu: ${data.place}
+Heure: ${data.time_start} - ${data.time_end}
+Joueurs convoqués: ${totalPlayers} joueur${totalPlayers > 1 ? 's' : ''} (${positionBreakdown})
+