public IActionResult Complete(int id) { if (_todoService.Complete(id)) { TempData["success"] = "Task completed!"; return(RedirectToAction("Index")); } else { TempData["error"] = "Some error(s) accured while task complete"; return(RedirectToAction("Index")); } }
public async Task <IActionResult> Complete(int id) { // Guards var existingItem = await _todoService.GetByIdAsync(id); if (existingItem == null) { return(NotFound()); } // Update logic _todoService.Complete(id); // Return update ok result return(NoContent()); }
public IActionResult Complete([FromRoute] int id) { _toDoService.Complete(id); return(Ok()); }
public JsonResult Complete(Guid id) { _todoService.Complete(id); return(Json(JsonEnvelope.Success())); }