From 91b62581c932a8ba0d12f2f871c77722dffc9eed Mon Sep 17 00:00:00 2001 From: CyberL1 Date: Mon, 20 May 2024 22:40:05 +0200 Subject: [PATCH] feat: expired realm deleting --- .../Controllers/WorldsController.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Minecraft-Realms-Emulator/Controllers/WorldsController.cs b/Minecraft-Realms-Emulator/Controllers/WorldsController.cs index e9095c4..6b749b4 100644 --- a/Minecraft-Realms-Emulator/Controllers/WorldsController.cs +++ b/Minecraft-Realms-Emulator/Controllers/WorldsController.cs @@ -297,5 +297,18 @@ namespace Minecraft_Realms_Emulator.Controllers return Ok(connection); } + + [HttpDelete("{wId}")] + public ActionResult DeleteRealm(int wId) + { + var world = _context.Worlds.Find(wId); + + if (world == null) return NotFound("World not found"); + + _context.Worlds.Remove(world); + _context.SaveChanges(); + + return Ok(true); + } } }