This commit is contained in:
@@ -6,6 +6,7 @@ import nl.connectedit.swiss.domain.TournamentStatus;
|
||||
import nl.connectedit.swiss.domain.entity.Tournament;
|
||||
import nl.connectedit.swiss.dto.ResultDto;
|
||||
import nl.connectedit.swiss.dto.TournamentDto;
|
||||
import nl.connectedit.swiss.dto.TournamentPlayerSubstitutionDto;
|
||||
import nl.connectedit.swiss.dto.TournamentValidationDto;
|
||||
import nl.connectedit.swiss.mapper.TournamentMapper;
|
||||
import nl.connectedit.swiss.mapper.TournamentValidationMapper;
|
||||
@@ -196,10 +197,10 @@ public class TournamentController {
|
||||
return ResponseEntity.noContent().build();
|
||||
}
|
||||
|
||||
@PostMapping("/tournaments/{tournamentId}/players/{playerId}/event/{eventId}/substitute/{substituteId}")
|
||||
public ResponseEntity<TournamentDto> substitutePlayer(@PathVariable Long tournamentId, @PathVariable Long playerId, @PathVariable Long eventId, @PathVariable Long substituteId) {
|
||||
@PostMapping("/tournaments/{tournamentId}/players/{playerId}/substitutions")
|
||||
public ResponseEntity<TournamentDto> substitutePlayer(@PathVariable Long tournamentId, @PathVariable Long playerId, @RequestBody TournamentPlayerSubstitutionDto[] substitutions) {
|
||||
var tournament = tournamentService.findTournamentById(tournamentId);
|
||||
|
||||
return ResponseEntity.ok(tournamentMapper.toDto(tournamentPlayService.substitutePlayer(tournament, eventId, playerId, substituteId)));
|
||||
return ResponseEntity.ok(tournamentMapper.toDto(tournamentPlayService.playerSubstitutions(tournament, playerId, substitutions)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user