feat: expired realm deleting

This commit is contained in:
CyberL1 2024-05-20 22:40:05 +02:00
parent 3e9b6a55de
commit 91b62581c9

View File

@ -297,5 +297,18 @@ namespace Minecraft_Realms_Emulator.Controllers
return Ok(connection);
}
[HttpDelete("{wId}")]
public ActionResult<bool> 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);
}
}
}