Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fixed price filter and flaky test

Damian Legawiec25620e6bb332
diff --git a/api/app/services/spree/api/v3/filters_aggregator.rb b/api/app/services/spree/api/v3/filters_aggregator.rb
index 0bdb9335fa..e8c84beb13 100644
--- a/api/app/services/spree/api/v3/filters_aggregator.rb
+++ b/api/app/services/spree/api/v3/filters_aggregator.rb
@@ -43,7 +43,8 @@ module Spree
end
def price_filter
- prices = Spree::Price.for_products(@scope, @currency)
+ # Remove ordering to avoid PostgreSQL DISTINCT + ORDER BY conflicts
+ prices = Spree::Price.for_products(@scope.reorder(''), @currency)
min = prices.minimum(:amount)
max = prices.maximum(:amount)
return nil if min.nil? || max.nil?
diff --git a/api/spec/integration/spree/api/v3/store/customers_spec.rb b/api/spec/integration/spree/api/v3/store/customers_spec.rb
index 07c2bd68e8..2eff8960ca 100644
--- a/api/spec/integration/spree/api/v3/store/customers_spec.rb
+++ b/api/spec/integration/spree/api/v3/store/customers_spec.rb
@@ -5,7 +5,7 @@ require 'swagger_helper'
RSpec.describe 'Customers API', type: :request, swagger_doc: 'api-reference/store.yaml' do
include_context 'API v3 Store'
- path '/api/v3/store/customers/me' do
+ path '/api/v3/store/customer' do
get 'Get current customer profile' do
tags 'Customers'
produces 'application/json'