[WIP]
This commit is contained in:
@@ -36,6 +36,22 @@ public partial class AuthorityManager
|
||||
return errors.Count > 0 ? ValidationResult.Fail(errors) : ValidationResult.Success();
|
||||
}
|
||||
|
||||
public async Task<Result<AuthorityUser>> GetUserByEmailAsync(string email)
|
||||
{
|
||||
if (string.IsNullOrEmpty(email))
|
||||
{
|
||||
return ResultError.Fail("No email given.");
|
||||
}
|
||||
|
||||
var user = await userRepository.GetUserByEmailAsync(email);
|
||||
if (user == null)
|
||||
{
|
||||
return ResultError.Fail("No user found with given email.");
|
||||
}
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
public async Task<Result<QueryItems<AuthorityUserItem>>> SearchUsersAsync(string query, int maxResults = 20, int offset = 0, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var result = await UserRepository.GetUsersAsync(maxResults, offset, query, cancellationToken);
|
||||
|
Reference in New Issue
Block a user