public ActionResult ApprovePost(string id) { PostsManager manager = new PostsManager(); var response = manager.GetById(int.Parse(id)); var post = response.Posts.First(); post.IsApproved = true; manager.Edit(post); return(RedirectToAction("Panel", "Admin")); }
public ActionResult UpdatePost(string id, string title, string body) { PostsManager manager = new PostsManager(); var response = manager.GetById(int.Parse(id)); var postToUpdate = response.Posts.First(); postToUpdate.PostTitle = title; postToUpdate.PostBody = body; manager.Edit(postToUpdate); return(RedirectToAction("Index", "Home")); }