Add shared pagination, projections and ownership helpers; simplify query and command handlers
This commit is contained in:
@@ -19,13 +19,13 @@ public class UnfollowUserCommandHandler(
|
||||
.SingleOrDefaultAsync(f => f.FollowerId == request.FollowerId && f.FollowedId == request.FollowedId, cancellationToken);
|
||||
|
||||
if (follow == null)
|
||||
return new Success();
|
||||
return Result.Success;
|
||||
|
||||
database.UserFollows.Remove(follow);
|
||||
await database.SaveChangesAsync(cancellationToken);
|
||||
|
||||
logger.LogInformation("User {FollowerId} unfollowed user {FollowedId}", request.FollowerId, request.FollowedId);
|
||||
|
||||
return new Success();
|
||||
return Result.Success;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user