public async Task <IActionResult> Update(TodoUpdateDto todo) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } string email = Helper.GetEmail(HttpContext); var isSuccesful = await _repo.UpdateTodo(todo, email); if (isSuccesful) { return(Ok("Todo updated succesfully")); } return(StatusCode(500)); }
public ActionResult UpdateTodo(string Id, [FromBody] Todo todo) { _repository.UpdateTodo(Id, todo); return(NoContent()); }