From 05a9628c59ff1c13ae94d5c9741625ee0c1e3934 Mon Sep 17 00:00:00 2001 From: jumc Date: Fri, 17 Nov 2023 16:37:18 -0300 Subject: [PATCH 1/3] Fix substring Otherwise we were only capturing the "OR" --- dotnet/Services/ProductReviewService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotnet/Services/ProductReviewService.cs b/dotnet/Services/ProductReviewService.cs index 68f1872..5184375 100644 --- a/dotnet/Services/ProductReviewService.cs +++ b/dotnet/Services/ProductReviewService.cs @@ -422,7 +422,7 @@ public async Task GetReviewsByProductId(string productId { localeQuery += $"(locale={locale}-{language}) OR"; } - localeQuery = localeQuery.Substring(localeQuery.Length - 2); + localeQuery = localeQuery.Substring(0, localeQuery.Length - 2); } if (pastRevNLocale) From 84cc2230897f7ed1bdfad4d2003264ad896631be Mon Sep 17 00:00:00 2001 From: "Juliana M. Crivelli" Date: Fri, 17 Nov 2023 16:41:19 -0300 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51cf46d..f13f306 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] +### Fixes + +- Locales substring start index + ## [3.14.3] - 2023-11-17 ### Changed From 0cdd6df66d8a8aeff6d373c812289dee90fd4ea0 Mon Sep 17 00:00:00 2001 From: jumc Date: Fri, 17 Nov 2023 16:59:44 -0300 Subject: [PATCH 3/3] Remove dangling else --- dotnet/Services/ProductReviewService.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/dotnet/Services/ProductReviewService.cs b/dotnet/Services/ProductReviewService.cs index 5184375..51fb464 100644 --- a/dotnet/Services/ProductReviewService.cs +++ b/dotnet/Services/ProductReviewService.cs @@ -462,7 +462,6 @@ public async Task GetReviewsByProductId(string productId localeQuery = $"&locale={locale}-*"; } } - else wrapper = await this._productReviewRepository.GetProductReviewsMD($"productId={productId}{sort}{searchQuery}{ratingQuery}{localeQuery}", from.ToString(), to.ToString()); }