Ability to remove archive Dungeons
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user