Esempio n. 1
0
        public IActionResult EditPost(string newEditPost, string id)
        {
            _logger.LogInformation($"{User.Identity.Name} is updating a comment");

            // Update in the DB
            var editToDb = _process.EditComment(id, newEditPost);

            if (editToDb)
            {
                return(RedirectToAction("Index", "Home"));
            }
            else
            {
                var error = new ErrorViewModel()
                {
                    ErrorMessage = "There was an issue editing your comment"
                };

                return(View("Error", error));
            }
        }