public async Task <IActionResult> AddNewCreditCard([FromBody] RequestAddNewCreditCardCommand command) { if (command == null) { return(BadRequest()); } command.UserId = User.FindFirst("access_token")?.Value; var response = await _mediator.Send(command); if (response.HasError) { return(BadRequest(new { errors = response.Errors.Select(x => x) })); } return(Created("", null)); }
public RequestAddNewCreditCardCommandBuild() { command = new RequestAddNewCreditCardCommand(); }