From 40ce3edba7347ebfe2772e007c1f994c6d1cfc40 Mon Sep 17 00:00:00 2001 From: jvyden Date: Mon, 21 Feb 2022 19:18:57 -0500 Subject: [PATCH] Use Database.RemoveSlot when removing slot on website --- .../Controllers/Website/Admin/AdminSlotController.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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(); }