Beispiel #1
0
        public ActionResult RemoveTag()
        {
            var json = GetJson(HttpContext.Request);

            ValidateJson(json);
            var tag       = json.Value <string>("tag");
            var articleId = json.Value <int>("id");

            FeedService.DeleteArticleTag(articleId, tag);
            return(Json(new
            {
                ok = "true"
            }));
        }
Beispiel #2
0
        public ActionResult RemoveTag(string tagName, int articleId)
        {
            var tag = FeedService.GetArticleTag(tagName, articleId);

            if (tag.CreatedBy != CurrentUser.Id)
            {
                if (tag.Approved && !CurrentUser.CanRemoveEntryTag)
                {
                    return(Json(false));
                }
            }

            FeedService.DeleteArticleTag(articleId, tagName);
            return(Json(true));
        }