Fix for editing match results
All checks were successful
Gitea/swiss-backend/pipeline/head This commit looks good
All checks were successful
Gitea/swiss-backend/pipeline/head This commit looks good
This commit is contained in:
@@ -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();
|
||||||
|
if (counter != null) { // match was already saved, this is a correction
|
||||||
|
var countingPlayer = getPlayer(tournament, counter.getId());
|
||||||
countingPlayer.setCounting(false);
|
countingPlayer.setCounting(false);
|
||||||
countingPlayer.incrementCounts();
|
countingPlayer.incrementCounts();
|
||||||
match.setCounter(null);
|
match.setCounter(null);
|
||||||
|
}
|
||||||
|
|
||||||
tournamentRepository.save(tournament);
|
tournamentRepository.save(tournament);
|
||||||
return tournament;
|
return tournament;
|
||||||
|
|||||||
Reference in New Issue
Block a user