public ActionResult UpdateChat(int id, int lastChatId) { var member = GetAuthorizedMember(); using (var sl = new SystemLogic()) { if (!sl.IsMemberOfDraft(member.Id, id)) { if (Request.IsAjaxRequest()) { return(Json(new { success = false })); } return(RedirectToAction("Index")); } var newChats = ConvertToChatViewModelList(sl.GetUpdatedChatList(id, lastChatId), member.Id); if (Request.IsAjaxRequest()) { return(Json(new { success = true, chats = newChats })); } return(RedirectToAction("Details", new { id = id })); } }