mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-15 14:12:27 +00:00
Replace Location table with packed 64-bit int (#679)
* Replace Location table with packed 64 bit int * Remove double Include and fix Slot documentation * Fix compilation errors from merge * Fix namespaces and add expected values to unit tests
This commit is contained in:
parent
575d2b7be7
commit
35ea2682b9
30 changed files with 996 additions and 930 deletions
|
@ -33,14 +33,11 @@ public class SlotPageController : ControllerBase
|
|||
WebToken? token = this.database.WebTokenFromRequest(this.Request);
|
||||
if (token == null) return this.Redirect("~/login");
|
||||
|
||||
Slot? targetSlot = await this.database.Slots.Include(s => s.Location).FirstOrDefaultAsync(s => s.SlotId == id);
|
||||
Slot? targetSlot = await this.database.Slots.FirstOrDefaultAsync(s => s.SlotId == id);
|
||||
if (targetSlot == null) return this.Redirect("~/slots/0");
|
||||
|
||||
if (targetSlot.Location == null) throw new ArgumentNullException(nameof(id));
|
||||
|
||||
if (targetSlot.CreatorId != token.UserId) return this.Redirect("~/slot/" + id);
|
||||
|
||||
this.database.Locations.Remove(targetSlot.Location);
|
||||
this.database.Slots.Remove(targetSlot);
|
||||
|
||||
await this.database.SaveChangesAsync();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue