Fix AgentName

This commit is contained in:
2025-10-10 16:08:50 +07:00
parent 7b92aa5727
commit 652c01b8bb
4 changed files with 121 additions and 10 deletions

View File

@@ -19,7 +19,7 @@ public class PostgreSqlUserRepository : BaseRepositoryWithLogging, IUserReposito
_cacheService = cacheService;
}
public async Task<User> GetUserByAgentNameAsync(string agentName)
public async Task<User?> GetUserByAgentNameAsync(string agentName)
{
return await ExecuteWithLoggingAsync(async () =>
{
@@ -51,7 +51,7 @@ public class PostgreSqlUserRepository : BaseRepositoryWithLogging, IUserReposito
.ConfigureAwait(false);
if (userEntity == null)
throw new InvalidOperationException($"User with agent name '{agentName}' not found");
return null;
var user = PostgreSqlMappers.Map(userEntity);