Different updates

Changed API behaviour to manage Session objects
Added route in frontend to link to API
This commit is contained in:
Alexis Leboeuf
2026-01-07 13:10:49 +01:00
parent 50230ea682
commit 68d4373d05
3 changed files with 36 additions and 41 deletions

View File

@@ -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) {