bug: missing images when not authenticated
This commit is contained in:
@@ -43,6 +43,7 @@ public class GetAlbumHandler(
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
AllowAnonymous();
|
||||
Get("/api/albums/{AlbumId}");
|
||||
Options(o => o.WithTags("Albums"));
|
||||
}
|
||||
@@ -51,13 +52,11 @@ public class GetAlbumHandler(
|
||||
GetAlbumRequest request,
|
||||
CancellationToken ct)
|
||||
{
|
||||
var userId = User.GetUserId();
|
||||
|
||||
var album = await context
|
||||
.Albums
|
||||
.Include(a => a.Photos.OrderBy(p => p.Order))
|
||||
.SingleOrDefaultAsync(
|
||||
a => a.Id == request.AlbumId && a.CreatedBy == userId,
|
||||
a => a.Id == request.AlbumId,
|
||||
cancellationToken: ct);
|
||||
|
||||
if (album is null)
|
||||
|
||||
Reference in New Issue
Block a user