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 {
final var message = String.format("%d/%d accepted visits", acceptedVisits, reportRequest.getVisits().size());
log.info(message);
if (acceptedVisits > 0) {
return ResponseEntity.ok(
ReportResponse.builder()
.success(true)
.message(message)
.build()
);
} else {
throw new CleaBadRequestException(message);
}
return ResponseEntity.ok(
ReportResponse.builder()
.success(true)
.message(message)
.build()
);
}
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