public ActionResult <string> DeleteKeep(int id) { if (_repo.DeleteKeep(id)) { return(Ok("Successfully Deleted!")); } return(BadRequest("Unable to delete!")); }
public ActionResult <string> Delete(int keepId) { bool wasSuccessful = _kr.DeleteKeep(keepId); if (wasSuccessful) { return(Ok()); } return(BadRequest()); }
public ActionResult <string> Delete(string keepId) { bool success = _kr.DeleteKeep(keepId); if (success) { return(Ok()); } return(BadRequest()); }
public ActionResult <string> Delete(int id) { bool successful = _kr.DeleteKeep(id); if (!successful) { return(BadRequest()); } return(Ok()); }
[HttpDelete("{id}")] //NOTE "Can Delete Keep" public ActionResult <string> Delete(int id) { try { _repo.DeleteKeep(id); return(Ok("Successfully Deleted")); } catch (Exception e) { return(BadRequest("Bad request")); } }
internal string DeleteKeep(int id, string profileId) { Keep toDelete = _repo.GetKeepById(id); if (profileId != toDelete.CreatorId) { throw new Exception("access denied"); } if (_repo.DeleteKeep(id)) { return("Success"); } else { throw new Exception("Invalid"); } }
public void Delete(int id) { db.DeleteKeep(id); }