exception if agentName is empty
This commit is contained in:
@@ -146,6 +146,9 @@ public class UserService : IUserService
|
||||
|
||||
public async Task<User> UpdateAgentName(User user, string agentName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(agentName))
|
||||
throw new Exception("Agent name cannot be empty");
|
||||
|
||||
// Check if agent name is already used
|
||||
var existingUser = await _userRepository.GetUserByAgentNameAsync(agentName);
|
||||
if (existingUser != null)
|
||||
|
||||
Reference in New Issue
Block a user