예제 #1
0
        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));
        }
예제 #2
0
 public RequestAddNewCreditCardCommandBuild()
 {
     command = new RequestAddNewCreditCardCommand();
 }