Consistency checks on participations changes ; plus some code cleaning

This commit is contained in:
Claude Brisson
2025-01-26 11:51:22 +01:00
parent 169546ae66
commit 0ed9bfb5eb
5 changed files with 37 additions and 23 deletions

View File

@@ -40,9 +40,10 @@ function leave(teamId, playerId) {
let team = teams.get(teamId);
let index = team.players.indexOf(playerId);
if (index > -1) {
team.players.splice(index, 1);
let newPlayers = team.players.slice();
newPlayers.splice(index, 1);
api.putJson(`tour/${tour_id}/team/${teamId}`, {
"players": team.players
"players": newPlayers
}).then(rst => {
if (rst !== 'error') {
document.location.reload();

View File

@@ -99,8 +99,8 @@
#set($black = $pmap[$game.b])
<tr>
<td class="t" data-table="${game.t}">${game.t}</td>
<td class="left">#if($white)${white.name} ${white.firstname} (#rank($white.rank), $white.country $white.club)#{else}BIP#end</td>
<td class="left">#if($black)${black.name} ${black.firstname} (#rank($black.rank), $black.country $black.club)#{else}BIP#end</td>
<td class="left">#if($white)${white.name} $!{white.firstname} (#rank($white.rank) $!white.country $!white.club)#{else}BIP#end</td>
<td class="left">#if($black)${black.name} $!{black.firstname} (#rank($black.rank) $!black.country $!black.club)#{else}BIP#end</td>
<td>${game.h}</td>
</tr>
#end