mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-10-04 15:19:43 +00:00
Finish most of Recent Activity
This commit is contained in:
parent
1737a16f38
commit
60d851fb15
77 changed files with 2725 additions and 443 deletions
|
@ -141,6 +141,22 @@ public class ReviewController : ControllerBase
|
|||
return this.Ok();
|
||||
}
|
||||
|
||||
[HttpGet("review/user/{slotId:int}/{reviewerName}")]
|
||||
public async Task<IActionResult> GetReview(int slotId, string reviewerName)
|
||||
{
|
||||
GameTokenEntity token = this.GetToken();
|
||||
|
||||
int reviewerId = await this.database.Users.Where(u => u.Username == reviewerName)
|
||||
.Select(s => s.UserId)
|
||||
.FirstOrDefaultAsync();
|
||||
if (reviewerId == 0) return this.NotFound();
|
||||
|
||||
ReviewEntity? review = await this.database.Reviews.FirstOrDefaultAsync(r => r.ReviewerId == reviewerId && r.SlotId == slotId);
|
||||
if (review == null) return this.NotFound();
|
||||
|
||||
return this.Ok(GameReview.CreateFromEntity(review, token));
|
||||
}
|
||||
|
||||
[HttpGet("reviewsFor/user/{slotId:int}")]
|
||||
public async Task<IActionResult> ReviewsFor(int slotId)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue