Skip to content

Commit

Permalink
userId fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rsemihkoca committed Jan 22, 2024
1 parent 8ac6973 commit 38a2b94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ExpenseApplication/Business/Commands/ExpenseCommandHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ public ExpenseCommandHandler(ExpenseDbContext dbContext, IMapper mapper, IHandle

public async Task<ExpenseResponse> Handle(CreateExpenseCommand request, CancellationToken cancellationToken)
{
(string role, int creatorId) = await validate.UserAuthAsync(request.Model.UserId, cancellationToken);

await validate.RecordExistAsync<User>(x => x.UserId == request.Model.UserId, cancellationToken);
await validate.RecordExistAsync<ExpenseCategory>(x => x.CategoryId == request.Model.CategoryId,
cancellationToken);

(string role, int creatorId) = await validate.UserAuthAsync(request.Model.UserId, cancellationToken);

var entity = mapper.Map<CreateExpenseRequest, Expense>(request.Model);
entity.CreatedBy = creatorId;

Expand Down

0 comments on commit 38a2b94

Please sign in to comment.