Пример #1
0
        public IActionResult NewPage(NewPageInputModel model)
        {
            if (ModelState.IsValid)
            {
                var user = GetCurrentUser(User.GetUserId()).Result;

                pageService.CreateNewPage(model.Name, model.Content, user);

                //Log
                //[UserName] created new page: {0}
                string content = string.Format("{0} created new page: {1}", GetCurrentUserName(User.GetUserId()), model.Name);
                logsService.AddNewLog("Create", content);

                return(RedirectToAction("EditStaticPages", new { pageName = model.Name }));
            }
            else
            {
                return(View());
            }
        }