diff --git a/CHANGELOG.md b/CHANGELOG.md index c39135a..58047d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/dotnet/Services/ProductReviewService.cs b/dotnet/Services/ProductReviewService.cs index 4a39ce5..3104560 100644 --- a/dotnet/Services/ProductReviewService.cs +++ b/dotnet/Services/ProductReviewService.cs @@ -930,6 +930,11 @@ private async Task 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)