Ability to remove archive Dungeons

This commit is contained in:
dingo
2026-01-31 10:47:32 -05:00
parent fd7a55e149
commit 4108d20555
2 changed files with 27 additions and 1 deletions
@@ -150,6 +150,22 @@ public class IndexModel : AdminPageModel
return RedirectToPage();
}
public async Task<IActionResult> OnPostDeleteArchiveAsync(Guid id)
{
var existing = await _db.Set<DungeonPersistence>().FindAsync(id);
if (existing == null)
{
TempData["Error"] = "Archived dungeon not found.";
return RedirectToPage();
}
_db.Set<DungeonPersistence>().Remove(existing);
await _db.SaveChangesAsync();
TempData["Message"] = "Archived dungeon deleted successfully.";
return RedirectToPage();
}
private static string FormatDuration(TimeSpan duration)
{