public ActionResult <string> Delete(int id) { if (_repo.DeleteKeep(id)) { return(Ok("Successfully deleted!")); } return(BadRequest("Unable to delete!")); }
public ActionResult Delete(int id) { if (_keepRepo.DeleteKeep(id)) { return(Ok("Successfully Deleted Keep")); } return(NotFound()); }
public ActionResult Delete(int id) { bool result = _kr.DeleteKeep(id); if (result) { return(Ok("Deleted keep")); } return(BadRequest("Could not find that keep to delete")); }
public ActionResult <string> DeleteKeep(int id) { //completely unsafe at this level; userid not checked? //TODO needs a little love to make sure there's not too much mess up if (_keepRepo.DeleteKeep(id)) { return(Ok()); } return(BadRequest()); }
public ActionResult <string> Delete(int id) { string userId = HttpContext.User.Identity.Name; bool successful = _kr.DeleteKeep(id, userId); if (!successful) { return(BadRequest("Something had gone horribly wrong")); } return(Ok("Successfully Deleted")); }
public ActionResult <string> Delete(int id) { string userId = HttpContext.User.FindFirstValue("Id"); if (userId.Contains(userId)) { try { _repo.DeleteKeep(id); } catch (Exception e) { return(BadRequest("Delete failed")); } } return(Ok("Successfully Deleted")); }
// [Authorize] public void DeleteKeep(int id) { _repo.DeleteKeep(id); }