public async Task <IActionResult> Put(int id, UpdateExpenseClaimCommand command) { if (id != command.Id) { return(BadRequest()); } return(Ok(await _mediator.Send(command))); }
public async Task <ApiResponse <int> > UpdateExpenseClaim(ExpenseClaimDetailViewModel expenseClaimDetailViewModel) { try { UpdateExpenseClaimCommand updateExpenseClaimCommand = _mapper.Map <UpdateExpenseClaimCommand>(expenseClaimDetailViewModel); await _client.UpdateExpenseClaimAsync(updateExpenseClaimCommand); return(new ApiResponse <int>() { Success = true }); } catch (ApiException ex) { return(ConvertApiExceptions <int>(ex)); } }
public async Task <ActionResult> Update([FromBody] UpdateExpenseClaimCommand updateExpenseClaimCommand) { await _mediator.Send(updateExpenseClaimCommand); return(NoContent()); }