diff --git a/ProjectLighthouse/Controllers/Website/Admin/AdminSlotController.cs b/ProjectLighthouse/Controllers/Website/Admin/AdminSlotController.cs index 3f84078f..ad99952e 100644 --- a/ProjectLighthouse/Controllers/Website/Admin/AdminSlotController.cs +++ b/ProjectLighthouse/Controllers/Website/Admin/AdminSlotController.cs @@ -62,10 +62,7 @@ public class AdminSlotController : ControllerBase if (slot.Location == null) throw new ArgumentNullException(); - this.database.Locations.Remove(slot.Location); - this.database.Slots.Remove(slot); - - await this.database.SaveChangesAsync(); + await this.database.RemoveSlot(slot); return this.Ok(); }