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: order by prop ReviewDateTime #263

Merged
merged 2 commits into from
Jul 22, 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed

- Fix order response of ProductReview when using orderBy reviewDateTime

## [3.15.0] - 2024-05-23

### Fixed
Expand Down
5 changes: 5 additions & 0 deletions dotnet/Services/ProductReviewService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
return reviews;
}

public async Task<IList<Review>> LimitReviews(IList<Review> reviews, int from, int to)

Check warning on line 245 in dotnet/Services/ProductReviewService.cs

View workflow job for this annotation

GitHub Actions / QE / Lint .Net

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
int take = maximumReturnedRecords;
if (to > 0)
Expand All @@ -255,7 +255,7 @@
return reviews;
}

public async Task<IList<Review>> FilterReviews(IList<Review> reviews, string searchTerm, string orderBy, string status)

Check warning on line 258 in dotnet/Services/ProductReviewService.cs

View workflow job for this annotation

GitHub Actions / QE / Lint .Net

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
if (reviews != null && reviews.Count > 0)
{
Expand Down Expand Up @@ -766,7 +766,7 @@
return await _productReviewRepository.SuccessfulMigration();
}

private async Task<Review> ConvertLegacyReview(LegacyReview review)

Check warning on line 769 in dotnet/Services/ProductReviewService.cs

View workflow job for this annotation

GitHub Actions / QE / Lint .Net

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
Review newReview = new Review
{
Expand Down Expand Up @@ -910,7 +910,7 @@
return retval;
}

private async Task<string> GetSortQuery(string orderBy)

Check warning on line 913 in dotnet/Services/ProductReviewService.cs

View workflow job for this annotation

GitHub Actions / QE / Lint .Net

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
string sort = string.Empty;
if (!string.IsNullOrEmpty(orderBy))
Expand All @@ -930,6 +930,11 @@

string fieldName = Char.ToLowerInvariant(pi.Name[0]) + pi.Name.Substring(1);

// Workaround: Sometimes master data returns in wrong order when sorting by reviewDateTime.
if(fieldName == "reviewDateTime") {
fieldName = "createdIn";
}

sort = $"&_sort={fieldName}";

if (descendingOrder)
Expand Down
Loading