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)); } }
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)); }