Commit 1d6ea9b6 authored by Bergamote Orange's avatar Bergamote Orange
Browse files

bugfix(clea-ws-rest): return 200 OK instead of 400 BAD REQUEST when no accepted visits

parent 4327697e
...@@ -40,16 +40,12 @@ public class CleaController implements CleaApi { ...@@ -40,16 +40,12 @@ public class CleaController implements CleaApi {
final var message = String.format("%d/%d accepted visits", acceptedVisits, reportRequest.getVisits().size()); final var message = String.format("%d/%d accepted visits", acceptedVisits, reportRequest.getVisits().size());
log.info(message); log.info(message);
if (acceptedVisits > 0) {
return ResponseEntity.ok( return ResponseEntity.ok(
ReportResponse.builder() ReportResponse.builder()
.success(true) .success(true)
.message(message) .message(message)
.build() .build()
); );
} else {
throw new CleaBadRequestException(message);
}
} }
private Visit toVisitNullSafe(fr.gouv.clea.ws.api.model.Visit visit) { private Visit toVisitNullSafe(fr.gouv.clea.ws.api.model.Visit visit) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment