public ActionResult CreateNewStory(AddWord addWord)
        {
            if (!ModelState.IsValid) return View("Index");

            _repository.AddWord(string.Empty, addWord.Word, _currentUser.UserID);

            return View("Index");
        }
        public JsonResult AddWord(AddWord addWord)
        {
            if (string.IsNullOrEmpty(addWord.StoryId)) throw new Exception("Story is required");
            if (string.IsNullOrEmpty(addWord.Word)) throw new Exception("Word is required");

            var result = _repository.AddWord("stories/" + addWord.StoryId, addWord.Word, _currentUser.UserID, addWord.NewParagraph);

            return Json(result, "application/json");
        }
Example #3
0
 public StoryPageView()
 {
     UserStoryList = new UserStoryList();
     AddWord = new AddWord();
 }