Different updates
Changed API behaviour to manage Session objects Added route in frontend to link to API
This commit is contained in:
@@ -42,6 +42,7 @@ public class SessionResource {
|
||||
public ResponseEntity<?> create(@RequestBody SessionDTO dto) {
|
||||
try {
|
||||
Session session = maptoEntity(dto);
|
||||
session.setCoach(coachDAO.findById(dto.getCoachId()).orElse(null));
|
||||
sessionDAO.save(session);
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(maptoDTO(session));
|
||||
} catch (Exception ex) {
|
||||
|
||||
Reference in New Issue
Block a user