Code formatting

This commit is contained in:
2026-02-04 14:55:22 +01:00
parent 23a9011b11
commit f0ea1fb957

View File

@@ -8,16 +8,20 @@ public static class ResultsEndpoints
{
public static void MapResultsEndpoints(this IEndpointRouteBuilder app)
{
app.MapGet("/api/results", async (HttpContext ctx, AppDbContext db) =>
app.MapGet(
"/api/results",
async (HttpContext ctx, AppDbContext db) =>
{
var phase = await EndpointHelpers.GetPhase(db);
if (phase != Phase.Results)
return EndpointHelpers.PhaseMismatch(Phase.Results, phase);
var player = await EndpointHelpers.GetAuthenticatedPlayer(ctx, db);
if (player is null) return Results.Unauthorized();
if (player is null)
return Results.Unauthorized();
var results = await db.Suggestions.AsNoTracking()
var results = await db
.Suggestions.AsNoTracking()
.Include(s => s.Player)
.Include(s => s.Votes)
.Select(s => new
@@ -34,12 +38,13 @@ public static class ResultsEndpoints
s.YoutubeUrl,
s.GameUrl,
s.Description,
s.Genre
s.Genre,
})
.OrderByDescending(r => r.Total)
.OrderByDescending(r => r.Average)
.ToListAsync();
return Results.Ok(results);
});
}
);
}
}