Refactor user ID handling in command handlers and update Protobuf package version to 0.0.124

This commit is contained in:
masoodafar-web
2025-11-20 23:18:07 +03:30
parent 0867244888
commit 8f25757307
18 changed files with 38 additions and 22 deletions

View File

@@ -15,12 +15,12 @@ public class GetUserQueryHandler : IRequestHandler<GetUserQuery, GetUserResponse
var userId = _currentUserService.UserId ?? throw new ForbiddenAccessException();
var response = await _context.User.GetUserAsync(request: new()
{
Id = long.Parse(userId)
Id = userId
}, cancellationToken: cancellationToken);
var result = response.Adapt<GetUserResponseDto>();
var getJwtToken = await _context.User.GetJwtTokenAsync(request: new()
{
Id = long.Parse(userId)
Id = userId
}, cancellationToken: cancellationToken);
if(getJwtToken != null && !string.IsNullOrWhiteSpace(getJwtToken.Token))
result.Token = getJwtToken.Token;