delete debug endpoint from TeamRestController.java

This commit is contained in:
2025-12-18 15:29:46 +01:00
parent 6a0ccda528
commit b43ef291ee
2 changed files with 0 additions and 24 deletions

View File

@@ -35,18 +35,6 @@ public class TeamRestController {
}
}
@PostMapping("createTeamDebug")
public ResponseEntity<@NonNull TeamWSTO> createTeam(){
Team team = teamService.createTeam();
try {
team.setTeamName("DEBUG");
teamService.updateTeam(team);
return new ResponseEntity<>(TeamWSTO.of(team), HttpStatus.CREATED);
} catch (TeamExistsException e) {
teamService.deleteTeam(team.getId());
return ResponseEntity.of(ProblemDetail.forStatusAndDetail(HttpStatus.CONFLICT,"This team already exists")).build();
}
}
@GetMapping("all")
public ResponseEntity<@NonNull List<TeamWSTO>> getAllTeams(){

View File

@@ -43,18 +43,6 @@ public class TeamService {
return teamRepository.findAll();
}
public Team createTeam() throws TeamExistsException {
Team team = new Team();
team.setTeamName(String.format("Team %d", teamRepository.count() + 1));
Racer racer = new Racer(null,"Paul", "Reichmuth",false,"0");
team.addMember(racer);
checkTeamIsDuplicate(team);
racerRepository.save(racer);
teamRepository.save(team);
log.info("Team created: {}", team);
return team;
}
public void createTeam(Team team) throws TeamExistsException{
checkTeamIsDuplicate(team);
teamRepository.save(team);