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.

Include missing values in storefront product property serializer

Damian Legawieccee364eea51b
diff --git a/api/app/serializers/spree/v2/storefront/product_property_serializer.rb b/api/app/serializers/spree/v2/storefront/product_property_serializer.rb
index d50639411c..2272e936ff 100644
--- a/api/app/serializers/spree/v2/storefront/product_property_serializer.rb
+++ b/api/app/serializers/spree/v2/storefront/product_property_serializer.rb
@@ -4,7 +4,7 @@ module Spree
class ProductPropertySerializer < BaseSerializer
set_type :product_property
- attribute :value, :filter_param
+ attribute :value, :filter_param, :show_property, :position
attribute :name do |product_property|
product_property.property_name
diff --git a/api/spec/requests/spree/api/v2/storefront/products_spec.rb b/api/spec/requests/spree/api/v2/storefront/products_spec.rb
index c8383a6931..8beefd0afb 100644
--- a/api/spec/requests/spree/api/v2/storefront/products_spec.rb
+++ b/api/spec/requests/spree/api/v2/storefront/products_spec.rb
@@ -231,6 +231,8 @@ describe 'API V2 Storefront Products Spec', type: :request do
expect(json_response['included']).to include(have_type('product_property').and(have_attribute(:name).with_value(property.name)))
expect(json_response['included']).to include(have_type('product_property').and(have_attribute(:value).with_value(product_property.value)))
expect(json_response['included']).to include(have_type('product_property').and(have_attribute(:filter_param).with_value(product_property.filter_param)))
+ expect(json_response['included']).to include(have_type('product_property').and(have_attribute(:show_property).with_value(product_property.show_property)))
+ expect(json_response['included']).to include(have_type('product_property').and(have_attribute(:position).with_value(product_property.position)))
end
end