Remove redundant stuff

This commit is contained in:
CyberL1 2024-03-17 20:44:46 +01:00
parent 1377f7e5a1
commit 007132bab3

View File

@ -137,14 +137,10 @@ namespace Minecraft_Realms_Emulator.Controllers
[HttpDelete("{wId}/invite/{uuid}")]
public async Task<ActionResult<bool>> DeleteInvite(int wId, string uuid)
{
Console.WriteLine($"{wId} - {uuid}");
var world = await _context.Worlds.FirstOrDefaultAsync(w => w.Id == wId);
if (world == null) return NotFound("World not found");
var players = world.Players.ToList();
var player = _context.Players.Where(p => p.World.Id == wId).FirstOrDefault(p => p.Uuid == uuid);
_context.Players.Remove(player);
@ -168,8 +164,6 @@ namespace Minecraft_Realms_Emulator.Controllers
if (world == null) return NotFound("World not found");
var players = world.Players.ToList();
var player = _context.Players.Where(p => p.World.Id == wId).FirstOrDefault(p => p.Uuid == playerUUID);
_context.Players.Remove(player);