case 4652 - a record that no longer exists gives "not found" instead of a server error; reports leave it out

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-31 14:40:01 -07:00
parent 91e8f54074
commit 6d3b169f23
10 changed files with 35 additions and 20 deletions

View File

@@ -76,6 +76,8 @@ namespace AyaNova.Api.Controllers
if (!ModelState.IsValid)
return BadRequest(new ApiErrorResponse(ModelState));
var o = await biz.GetAsync(id);
if (o == null && !biz.HasErrors)
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
if (o == null)
return BadRequest(new ApiErrorResponse(biz.Errors));
return Ok(ApiOkResponse.Response(o));
@@ -145,6 +147,8 @@ namespace AyaNova.Api.Controllers
if (!ModelState.IsValid)
return BadRequest(new ApiErrorResponse(ModelState));
var o = await biz.GetAsync(id);
if (o == null && !biz.HasErrors)
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
if (o == null)
return BadRequest(new ApiErrorResponse(biz.Errors));
return Ok(ApiOkResponse.Response(new