Standardize service errors with ProblemDetails envelope

This commit is contained in:
2026-02-07 01:23:54 +01:00
parent 79dc8f899f
commit f615ef3a4a
9 changed files with 63 additions and 33 deletions

View File

@@ -11,7 +11,7 @@ internal sealed class ResultsWorkflowService(AppDbContext db)
{
var appState = await db.AppState.AsNoTracking().FirstAsync();
if (!appState.ResultsOpen)
return Results.BadRequest(new { error = "Results are locked until the admin enables them." });
return EndpointHelpers.BadRequestError("Results are locked until the admin enables them.");
var phase = await EndpointHelpers.GetCurrentPhaseAsync(db, player.Id);
if (phase != Phase.Results)