public IActionResult Submissions(AdminSubmissionsViewModel model) { if (!IsAdmin()) { return(BadRequest("Not authenticated")); } if (!model.DoAction(_ctx, out var msg)) { return(BadRequest(msg)); } return(Ok(msg)); }
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)); }