Merge branch 'main' into recent-activity

This commit is contained in:
Josh 2024-05-13 18:41:40 -05:00 committed by GitHub
commit 27cbb14a49
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 145 additions and 3 deletions

View file

@ -173,6 +173,13 @@ public class ReviewController : ControllerBase
List<GameReview> reviews = (await this.database.Reviews
.Where(r => r.SlotId == slotId)
.Select(r => new
{
Review = r,
SlotVersion = r.Slot!.GameVersion,
})
.Where(a => a.SlotVersion <= token.GameVersion)
.Select(a => a.Review)
.OrderByDescending(r => r.ThumbsUp - r.ThumbsDown)
.ThenByDescending(r => r.Timestamp)
.ApplyPagination(pageData)
@ -194,6 +201,13 @@ public class ReviewController : ControllerBase
List<GameReview> reviews = (await this.database.Reviews
.Where(r => r.ReviewerId == targetUserId)
.Select(r => new
{
Review = r,
SlotVersion = r.Slot!.GameVersion,
})
.Where(a => a.SlotVersion <= token.GameVersion)
.Select(a => a.Review)
.OrderByDescending(r => r.Timestamp)
.ApplyPagination(pageData)
.ToListAsync()).ToSerializableList(r => GameReview.CreateFromEntity(r, token));