Skip to content
Snippets Groups Projects
Commit ee154cda authored by Diana Gulčíková's avatar Diana Gulčíková
Browse files

fix post endpoint

parent af9eb48e
No related branches found
No related tags found
2 merge requests!60Docker,!55Race fixes schema
......@@ -48,6 +48,14 @@ public class RaceService implements RaceServiceI {
@Transactional
public RaceDto postRace(RaceDto raceDto) {
raceDto.setId(null);
if (raceDto.getDriverOne() != null && raceDto.getDriverOne().getDriverId() != null) {
dbGetter.getDriver(raceDto.getDriverOne().getDriverId());
}
if (raceDto.getDriverTwo() != null && raceDto.getDriverTwo().getDriverId() != null) {
dbGetter.getDriver(raceDto.getDriverTwo().getDriverId());
}
return convertRace(raceRepository.save(convertRaceDto(raceDto)));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment