Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug where reviews would always contain your own level rating instead of that of the reviewer's #688

Merged
merged 2 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Refresh.GameServer/Endpoints/Game/ReviewEndpoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public Response GetReviewsForLevel(RequestContext context, GameDatabaseContext d

[GameEndpoint("reviewsBy/{username}", ContentType.Xml)]
[AllowEmptyBody]
public Response GetReviewsForLevel(RequestContext context, GameDatabaseContext database, string username,
public Response GetReviewsByUser(RequestContext context, GameDatabaseContext database, string username,
DataContext dataContext)
{
GameUser? user = database.GetUserByUsername(username);
Expand Down
2 changes: 1 addition & 1 deletion Refresh.GameServer/Types/Reviews/SerializedGameReview.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
public int Id { get; set; }

[XmlElement("slot_id")]
public GameReviewSlot Slot { get; set; }

Check warning on line 19 in Refresh.GameServer/Types/Reviews/SerializedGameReview.cs

View workflow job for this annotation

GitHub Actions / Build, Test, and Upload Builds

Non-nullable property 'Slot' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 19 in Refresh.GameServer/Types/Reviews/SerializedGameReview.cs

View workflow job for this annotation

GitHub Actions / Build, Test, and Upload Builds

Non-nullable property 'Slot' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

[XmlElement("reviewer")]
public string Reviewer { get; set; }

Check warning on line 22 in Refresh.GameServer/Types/Reviews/SerializedGameReview.cs

View workflow job for this annotation

GitHub Actions / Build, Test, and Upload Builds

Non-nullable property 'Reviewer' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 22 in Refresh.GameServer/Types/Reviews/SerializedGameReview.cs

View workflow job for this annotation

GitHub Actions / Build, Test, and Upload Builds

Non-nullable property 'Reviewer' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

[XmlElement("timestamp")]
public long Timestamp { get; set; }
Expand Down Expand Up @@ -74,7 +74,7 @@
Deleted = false,
DeletedBy = ReviewDeletedBy.None,
Text = review.Content,
Thumb = dataContext.Database.GetRatingByUser(review.Level, dataContext.User!)?.ToDPad() ?? 0,
Thumb = dataContext.Database.GetRatingByUser(review.Level, review.Publisher)?.ToDPad() ?? 0,
ThumbsUp = reviewRatings.PositiveRating,
ThumbsDown = reviewRatings.NegativeRating,
YourThumb = (int) userRatingType,
Expand Down
Loading