Example #1
0
 public ActionResult <string> Delete(int id)
 {
     if (_repo.DeleteKeep(id))
     {
         return(Ok("Successfully deleted!"));
     }
     return(BadRequest("Unable to delete!"));
 }
Example #2
0
 public ActionResult Delete(int id)
 {
     if (_keepRepo.DeleteKeep(id))
     {
         return(Ok("Successfully Deleted Keep"));
     }
     return(NotFound());
 }
Example #3
0
        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"));
        }
Example #4
0
 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"));
        }
Example #6
0
        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"));
        }
Example #7
0
        // [Authorize]
        public void DeleteKeep(int id)

        {
            _repo.DeleteKeep(id);
        }