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

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

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

            if (!successful)
            {
                return(BadRequest());
            }
            return(Ok());
        }
Ejemplo n.º 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");
            }
        }
Ejemplo n.º 7
0
 public void Delete(int id)
 {
     db.DeleteKeep(id);
 }