コード例 #1
0
        public async Task <IActionResult> MoverListaLixeiraAsync(string listaId)
        {
            try
            {
                await _listaRepository.UpdateListaStatusLixeiraAsync(listaId, _userManager.GetUserId(User));

                return(Ok(new { mensagem = "Lista excluida com sucesso." }));
            }
            catch (Exception e)
            {
                ModelState.AddModelError(string.Empty, e.Message);
            }

            return(BadRequest(new { mensagens = ModelState.Values.SelectMany(x => x.Errors.Select(x => x.ErrorMessage)) }));
        }