Add shared pagination, projections and ownership helpers; simplify query and command handlers

This commit is contained in:
2026-09-24 11:59:34 +02:00
parent 5a0f82b77b
commit 4b147d9ee3
84 changed files with 547 additions and 767 deletions
@@ -25,7 +25,7 @@ public static class AlbumEndpoints
.AddEndpointFilter<ValidationFilter<PageQuery>>()
.WithName("GetAlbums")
.WithSummary("Get Paginated Albums, Optionally Filtered By Title.")
.Produces<AlbumsSearchResponse>();
.Produces<PaginatedResponse<AlbumApplicationResponse>>();
group.MapGet("/{id}", GetAlbumById)
.WithName("GetAlbumById")
@@ -129,7 +129,7 @@ public static class AlbumEndpoints
[AsParameters] PageQuery page)
{
var result = await mediator.Send(new GetAlbumsQuery(title, page.PageNumber, page.PageSize), cancellationToken);
return result.ToHttpResult();
return Results.Ok(result);
}
private static async Task<IResult> GetAlbumById(
@@ -166,7 +166,7 @@ public static class AlbumEndpoints
}
var result = await mediator.Send(new GetRecentlyListenedAlbumsQuery(currentUser.RequiredId, limit), cancellationToken);
return result.ToHttpResult();
return Results.Ok(result);
}
private static async Task<IResult> GetAlbumTracks(