mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-06 20:08:40 +00:00
Fix /s/user/{id} endpoint
This commit is contained in:
parent
a0a21e4898
commit
f941befc7e
1 changed files with 6 additions and 8 deletions
|
@ -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<IActionResult> SUser(int id) {
|
||||
Slot slot = await new Database().Slots.FirstOrDefaultAsync(s => s.SlotId == id);
|
||||
public IActionResult SUser(int id) {
|
||||
IEnumerable<Slot> 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));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue