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.

Only return pages that have slugs -> (don't return homepages in an API request for standard pages)

Matthew Kennedy2c9319cad35c
diff --git a/api/app/controllers/spree/api/v2/storefront/cms_pages_controller.rb b/api/app/controllers/spree/api/v2/storefront/cms_pages_controller.rb
index 5c96488f64..2960bcae77 100644
--- a/api/app/controllers/spree/api/v2/storefront/cms_pages_controller.rb
+++ b/api/app/controllers/spree/api/v2/storefront/cms_pages_controller.rb
@@ -20,6 +20,10 @@ module Spree
def collection_serializer
Spree::Api::Dependencies.storefront_cms_page_serializer.constantize
end
+
+ def scope
+ super.by_store(current_store).by_locale(I18n.locale).linkable_pages
+ end
end
end
end