Example #1
0
 public ActionResult <string> DeleteKeep(int id)
 {
     if (_repo.DeleteKeep(id))
     {
         return(Ok("Successfully Deleted!"));
     }
     return(BadRequest("Unable to delete!"));
 }
Example #2
0
        public ActionResult <string> Delete(int keepId)
        {
            bool wasSuccessful = _kr.DeleteKeep(keepId);

            if (wasSuccessful)
            {
                return(Ok());
            }
            return(BadRequest());
        }
Example #3
0
        public ActionResult <string> Delete(string keepId)
        {
            bool success = _kr.DeleteKeep(keepId);

            if (success)
            {
                return(Ok());
            }
            return(BadRequest());
        }
Example #4
0
        public ActionResult <string> Delete(int id)
        {
            bool successful = _kr.DeleteKeep(id);

            if (!successful)
            {
                return(BadRequest());
            }
            return(Ok());
        }
Example #5
0
 [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);
 }