Files

20 lines
580 B
C#
Raw Permalink Normal View History

using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using SoroushAsadi.Services;
namespace SoroushAsadi.Pages.Admin.Sections;
[Authorize]
public class SectionsIndexModel(ContentService content) : PageModel
{
public IReadOnlySet<string> OverrideKeys { get; private set; } = new HashSet<string>();
public void OnGet() => OverrideKeys = content.GetSectionKeys().ToHashSet();
public IActionResult OnPostReset(string key)
{
content.DeleteSection(key);
return RedirectToPage();
}
}