public ActionResult DeleteResource(string themeName, string resource) { if (string.IsNullOrWhiteSpace(themeName) || string.IsNullOrWhiteSpace(resource)) { return this.AjaxFail("Access is denied", HttpStatusCode.BadRequest); } try { var remover = new ResourceRemover(themeName, resource); remover.Delete(); } catch (ResourceRemoveException ex) { return this.AjaxFail(ex.Message, HttpStatusCode.InternalServerError); } return Json(new {success = true}, JsonRequestBehavior.AllowGet); }
public ActionResult DeleteResource(string themeName, string resource) { if(string.IsNullOrWhiteSpace(themeName) || string.IsNullOrWhiteSpace(resource)) { return this.AccessDenied(); } try { var remover = new ResourceRemover(themeName, resource); remover.Delete(this.Tenant); } catch(ResourceRemoveException ex) { return this.Failed(ex.Message, HttpStatusCode.InternalServerError); } return this.Ok(); }