Fix for editing match results
All checks were successful
Gitea/swiss-backend/pipeline/head This commit looks good

This commit is contained in:
2025-08-28 23:21:38 +02:00
parent e89a7d4bff
commit 06b112305b

View File

@@ -288,10 +288,13 @@ public class TournamentPlayService {
match.getGames().clear(); match.getGames().clear();
match.getGames().addAll(resultToGames(result, match)); match.getGames().addAll(resultToGames(result, match));
var countingPlayer = getPlayer(tournament, match.getCounter().getId()); var counter = match.getCounter();
countingPlayer.setCounting(false); if (counter != null) { // match was already saved, this is a correction
countingPlayer.incrementCounts(); var countingPlayer = getPlayer(tournament, counter.getId());
match.setCounter(null); countingPlayer.setCounting(false);
countingPlayer.incrementCounts();
match.setCounter(null);
}
tournamentRepository.save(tournament); tournamentRepository.save(tournament);
return tournament; return tournament;