public async Task <IActionResult> Complete(int id, bool status) { try { var result = await _repository.CompleteAsync(id, status); return(Ok(result)); } catch (Exception) { return(StatusCode(StatusCodes.Status500InternalServerError, "Failed to complete task!")); } }
public async Task <IActionResult> Complete(int id, bool status) { var result = await _repository.CompleteAsync(id, status); return(RedirectToAction(nameof(Index))); }