Ejemplo n.º 1
0
        public async Task <IActionResult> AddAccess([FromBody] ActivateAccountDTO model)
        {
            try
            {
                await this.accountService.AddAsync(model.AccountId);

                return(Ok(model));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> ActivateAccount([FromBody] ActivateAccountDTO model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var token = new AuthJwtTokenDTO();

            try
            {
                token.Token = await this.accountService.ActivateAccountByIdAsync(model.AccountId);
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
            return(Ok(token));
        }