public IActionResult SetMenu(IFormFile menu_personalizado) { var page = _documentationApi.GetPage(RUTA_MENU); Guid menuID = Guid.Empty; if (page != null) { menuID = page.PageId; } _documentationApi.CreatePage(menuID, RUTA_MENU, menu_personalizado); return(RedirectToAction("Index")); }
public IActionResult Create(PageViewModel new_page) { var page = _documentationApi.GetPage(new_page.Route); if (page != null && new_page.PageId.Equals(Guid.Empty)) { ModelState.AddModelError("Route", "Ruta ya usada"); } if (!ModelState.IsValid) { return(View("Create", new_page)); } _documentationApi.CreatePage(new_page.PageId, new_page.Route, new_page.FileHtml); return(RedirectToAction("Details", new { route = new_page.Route })); }