chore(codebase): full cleanup pass
This commit is contained in:
@@ -38,14 +38,14 @@ public class RemovePhotoFromAlbumHandler(
|
||||
RemovePhotoFromAlbumRequest request,
|
||||
CancellationToken ct)
|
||||
{
|
||||
var userId = User.GetUserId();
|
||||
Guid userId = User.GetUserId();
|
||||
|
||||
var album = await context
|
||||
Album? album = await context
|
||||
.Albums
|
||||
.Include(a => a.Photos)
|
||||
.SingleOrDefaultAsync(
|
||||
a => a.Id == request.AlbumId && a.CreatedBy == userId,
|
||||
cancellationToken: ct);
|
||||
ct);
|
||||
|
||||
if (album is null)
|
||||
{
|
||||
@@ -53,7 +53,7 @@ public class RemovePhotoFromAlbumHandler(
|
||||
return;
|
||||
}
|
||||
|
||||
var photo = album.Photos
|
||||
AlbumPhoto? photo = album.Photos
|
||||
.SingleOrDefault(p => p.Id == request.PhotoId);
|
||||
|
||||
if (photo is null)
|
||||
@@ -65,9 +65,9 @@ public class RemovePhotoFromAlbumHandler(
|
||||
// Soft delete the photo
|
||||
photo.DeletedBy = userId;
|
||||
photo.DeletedAt = DateTimeOffset.UtcNow;
|
||||
|
||||
|
||||
await context.SaveChangesAsync(ct);
|
||||
|
||||
await SendNoContentAsync(ct);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user