Consistency checks on participations changes ; plus some code cleaning
This commit is contained in:
@@ -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();
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user