Fix include slot location and creator arg (#285)

This commit is contained in:
Josh 2022-04-13 22:43:14 -05:00 committed by GitHub
commit d70b9a8f82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,7 +39,7 @@ public class SlotsController : ControllerBase
string response = Enumerable.Aggregate
(
this.database.Slots.ByGameVersion(gameVersion, token.UserId == user.UserId)
this.database.Slots.ByGameVersion(gameVersion, token.UserId == user.UserId, true)
.Where(s => s.Creator!.Username == user.Username)
.Skip(pageStart - 1)
.Take(Math.Min(pageSize, ServerSettings.Instance.EntitledSlots)),
@ -77,7 +77,7 @@ public class SlotsController : ControllerBase
GameVersion gameVersion = token.GameVersion;
Slot? slot = await this.database.Slots.ByGameVersion(gameVersion, true).FirstOrDefaultAsync(s => s.SlotId == id);
Slot? slot = await this.database.Slots.ByGameVersion(gameVersion, true, true).FirstOrDefaultAsync(s => s.SlotId == id);
if (slot == null) return this.NotFound();
@ -403,4 +403,4 @@ public class SlotsController : ControllerBase
return whereSlots.Include(s => s.Creator).Include(s => s.Location);
}
}
}