public async Task <IActionResult> Conclude(Guid id)
        {
            var todo = _mapper.Map <TodoViewModel>(await _todoAppService.GetById(id));

            var todoViewModel = _todoAppService.Conclude(todo);

            TempData["Success"] = "Tarefa concluída com successo!";

            return(RedirectToAction(nameof(Index)));
        }
Ejemplo n.º 2
0
        public IActionResult Conclude([FromBody] TodoViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var todoViewModel = _todoAppService.Conclude(model);

            return(Ok(todoViewModel));
        }