public ActionResult Delete(int id, [FromQuery] int todoId, [FromQuery] int userId)
 {
     try
     {
         _subTaskService.DeleteSubTask(id, todoId, userId);
         Debug.WriteLine($"Successfully deleted Subtask {id}");
         return(Ok("Successfully deleted Subtask"));
     }
     catch (Exception ex)
     {
         Debug.WriteLine($"SUBTASK: {ex.Message}");
         return(BadRequest(ex.Message));
     }
 }
Exemple #2
0
 public IActionResult Delete(int id)
 {
     try
     {
         _subTaskService.DeleteSubTask(id);
         return(Ok("Success"));
     }
     catch (CustomException ex)
     {
         return(BadRequest(ex.Message));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
Exemple #3
0
 public IHttpActionResult DeleteSubTask(int id)
 {
     try
     {
         subTaskService.DeleteSubTask(id);
         return(StatusCode(HttpStatusCode.NoContent));
     }
     catch (ValidationException)
     {
         return(NotFound());
     }
     catch (DatabaseException)
     {
         return(BadRequest());
     }
     catch (Exception)
     {
         return(InternalServerError());
     }
 }
 public IActionResult DeleteSubTask(SubTaskViewModel model)
 {
     _subTaskServices.DeleteSubTask(model.Id);
     return(RedirectToAction("GetById", "Task", new { id = model.TaskId }));
 }