mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-08 04:48:44 +00:00
Fix cross-user comments, only show slots by user on planet
This commit is contained in:
parent
e4337db45f
commit
4c97972143
2 changed files with 3 additions and 1 deletions
|
@ -22,6 +22,7 @@ namespace ProjectLighthouse.Controllers {
|
||||||
public async Task<IActionResult> GetComments(string username) {
|
public async Task<IActionResult> GetComments(string username) {
|
||||||
List<Comment> comments = await database.Comments
|
List<Comment> comments = await database.Comments
|
||||||
.Include(c => c.Target)
|
.Include(c => c.Target)
|
||||||
|
.Include(c => c.Poster)
|
||||||
.Where(c => c.Target.Username == username)
|
.Where(c => c.Target.Username == username)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
|
|
|
@ -16,11 +16,12 @@ namespace ProjectLighthouse.Controllers {
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("slots/by")]
|
[HttpGet("slots/by")]
|
||||||
public IActionResult SlotsBy() {
|
public IActionResult SlotsBy([FromQuery] string u) {
|
||||||
string response = Enumerable.Aggregate(
|
string response = Enumerable.Aggregate(
|
||||||
database.Slots
|
database.Slots
|
||||||
.Include(s => s.Creator)
|
.Include(s => s.Creator)
|
||||||
.Include(s => s.Location)
|
.Include(s => s.Location)
|
||||||
|
.Where(s => s.Creator.Username == u)
|
||||||
, string.Empty, (current, slot) => current + slot.Serialize());
|
, string.Empty, (current, slot) => current + slot.Serialize());
|
||||||
|
|
||||||
return this.Ok(LbpSerializer.TaggedStringElement("slots", response, "total", 1));
|
return this.Ok(LbpSerializer.TaggedStringElement("slots", response, "total", 1));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue