Skip to content

Commit

Permalink
Fix: order by prop ReviewDateTime (#263)
Browse files Browse the repository at this point in the history
* Fix: order by prop ReviewDateTime

* Update changelog.md
  • Loading branch information
choque9 authored Jul 22, 2024
1 parent 58d23e2 commit 7bb03d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
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 @@ -930,6 +930,11 @@ private async Task<string> GetSortQuery(string orderBy)

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

0 comments on commit 7bb03d4

Please sign in to comment.