diff --git a/ProjectLighthouse/Controllers/SlotsController.cs b/ProjectLighthouse/Controllers/SlotsController.cs index ba095e09..1900932c 100644 --- a/ProjectLighthouse/Controllers/SlotsController.cs +++ b/ProjectLighthouse/Controllers/SlotsController.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; @@ -18,15 +19,12 @@ namespace ProjectLighthouse.Controllers { } [HttpGet("s/user/{id:int}")] - public async Task SUser(int id) { - Slot slot = await new Database().Slots.FirstOrDefaultAsync(s => s.SlotId == id); + public IActionResult SUser(int id) { + IEnumerable slots = new Database().Slots + .Where(s => s.CreatorId == id) + .AsEnumerable(); - return this.Ok(slot.Serialize()); - } - - [HttpGet("slots/lolcatftw/{username}")] - public IActionResult SlotsLolCat(string username) { - string response = Enumerable.Aggregate(new Database().Slots, string.Empty, (current, slot) => current + slot.Serialize()); + string response = slots.Aggregate(string.Empty, (current, s) => current + s.Serialize()); return this.Ok(LbpSerializer.TaggedStringElement("slots", response, "total", 1)); }