public async Task <ApiResponse <int> > CreateExpenseClaim(ExpenseClaimDetailViewModel expenseClaimDetailViewModel) { try { CreateExpenseClaimCommand createExpenseClaimCommand = _mapper.Map <CreateExpenseClaimCommand>(expenseClaimDetailViewModel); var response = await _client.AddExpenseClaimAsync(createExpenseClaimCommand); return(new ApiResponse <int>() { Data = response.ExpenseClaim.ExpenseClaimId, Success = true }); } catch (ApiException ex) { return(ConvertApiExceptions <int>(ex)); } }
public async Task <IActionResult> Post(CreateExpenseClaimCommand command) { return(Ok(await _mediator.Send(command))); }
public async Task <ActionResult <CreateExpenseClaimCommandResponse> > Create([FromBody] CreateExpenseClaimCommand createExpenseClaimCommand) { var createExpenseClaimCommandResponse = await _mediator.Send(createExpenseClaimCommand); return(Ok(createExpenseClaimCommandResponse)); }
public async Task <ActionResult <ExpenseClaimResponseDto> > Post(CreateExpenseClaimCommand command) { return(await Mediator.Send(command)); }