Api : demande absolument un Optional
/**
* GET /agences/:id/taux : get tauxes for the "id" agence.
*
* @param id the id of the agence to retrieve
* @return the ResponseEntity with status 200 (OK) and with body tauxes between startDate and endDate, or with status 404 (Not Found)
*/
@GetMapping("/agences/{id}/taux/{startDate}/{endDate}")
@Timed
public ResponseEntity<Agence> getAgenceTaux(@PathVariable Long id, @PathVariable Instant startDate, @PathVariable Instant endDate) {
log.debug("REST request to get Tauxes for agence : {}", id);
Optional<Agence> agence = agenceRepository.findById(id);
Set<Taux>tauxes = agence.get().getTauxes();
return ResponseUtil.wrapOrNotFound(tauxes);
}
Edited by Theo Echevet