Example #1
0
        public ActionResult DeleteRule([FromBody] DeleteRuleModel model)
        {
            if (Context == null || string.IsNullOrWhiteSpace(Context.UserId))
            {
                CreateResponse("Unauthorized");
            }
            if (model == null || string.IsNullOrWhiteSpace(model.RuleId))
            {
                CreateResponse("Invalid model");
            }

            bool success = dataCore.DeleteRule(ObjectId.Parse(model.RuleId), ObjectId.Parse(Context.UserId));

            return(CreateResponse(success: success));
        }