Пример #1
0
        public IActionResult Submissions(AdminSubmissionsViewModel model)
        {
            if (!IsAdmin())
            {
                return(BadRequest("Not authenticated"));
            }

            if (!model.DoAction(_ctx, out var msg))
            {
                return(BadRequest(msg));
            }

            return(Ok(msg));
        }
Пример #2
0
        public IActionResult Submissions()
        {
            if (!IsAdmin())
            {
                var statusModel = new StatusViewModel {
                    IsError = true, Message = "Not authenticated"
                };
                return(RedirectToAction("Status", "Home", statusModel));
            }

            var model = new AdminSubmissionsViewModel();

            model.GetSubmissions(_ctx);

            return(View(model));
        }