Just cleanup
This commit is contained in:
@@ -8,14 +8,14 @@ public class GetCurrentUserQueryHandler(
|
||||
IApplicationDbContext context,
|
||||
IMapper mapper,
|
||||
IIdentityService identityService
|
||||
)
|
||||
)
|
||||
: IRequestHandler<GetCurrentUserQuery, UserDto>
|
||||
{
|
||||
public async Task<UserDto> Handle(GetCurrentUserQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
var identityUser = await identityService.GetCurrentUserAsync();
|
||||
var currentUserId = new Guid(identityUser?.Id ?? "");
|
||||
|
||||
var currentUserId = Guid.Parse(identityUser!.Id!);
|
||||
|
||||
var transactions = await context.UserTransactions
|
||||
.Where(x => x.ApplicationUserId == currentUserId.ToString())
|
||||
.OrderBy(x => x.LastModified)
|
||||
@@ -30,7 +30,7 @@ public class GetCurrentUserQueryHandler(
|
||||
Id = currentUserId,
|
||||
FirstName = identityUser?.FirstName ?? "",
|
||||
LastName = identityUser?.LastName ?? "",
|
||||
UserName =identityUser?.UserName ?? "",
|
||||
UserName = identityUser?.UserName ?? "",
|
||||
UserTransactions = transactions,
|
||||
TotalBalance = transactions.Sum(x => x.Amount),
|
||||
UserRoles = roles
|
||||
|
||||
Reference in New Issue
Block a user