Improved results handling in service layer
This commit is contained in:
@@ -15,6 +15,6 @@ public sealed class IdentityService(IDbContextFactory<ApplicationDbContext> cont
|
||||
var userExistsAndActive = await context.Users
|
||||
.AnyAsync(u => u.Id == userId && u.Status == ActivityStatus.Active, cancellationToken);
|
||||
|
||||
return Result.FailIf(!userExistsAndActive, NotFoundError.Create());
|
||||
return Result.OkIf(userExistsAndActive, NotFoundError.Create());
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user