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.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Fix change from unique_code to location in menus API
Matthew Kennedyd4c45414a94c
diff --git a/api/config/routes.rb b/api/config/routes.rbindex 4d2e6ae4e5..2aaeca5dc4 100644--- a/api/config/routes.rb+++ b/api/config/routes.rb@@ -165,7 +165,7 @@ Spree::Core::Engine.add_routes doget '/stores/:code', to: 'stores#show', as: :storeresources :menus, only: %i[index]- get '/menus/:unique_code', to: 'menus#show', as: :menu+ get '/menus/:location', to: 'menus#show', as: :menuendnamespace :platform dodiff --git a/core/app/finders/spree/menus/find.rb b/core/app/finders/spree/menus/find.rbindex 2090312ea8..d8f6ad61d4 100644--- a/core/app/finders/spree/menus/find.rb+++ b/core/app/finders/spree/menus/find.rb@@ -2,7 +2,7 @@ module Spreemodule Menusclass Find < ::Spree::BaseFinderdef execute- return scope.where(unique_code: params[:filter]['unique_code']) if params[:filter].present?+ return scope.where(location: params[:filter]['location']) if params[:filter].present?scopeenddiff --git a/core/config/locales/en.yml b/core/config/locales/en.ymlindex f6fb07bcdb..d405ae6650 100644--- a/core/config/locales/en.yml+++ b/core/config/locales/en.yml@@ -625,7 +625,6 @@ en:menus: Menusmenu_items: '%{menu_name} Items'public_details: Public Details- unique_code_store_error: 'The code: %{code} is already used for Menu: %{menus}, make sure your unique code is unique within the store it is being used for.'subtitle: Subtitleurl_info: 'The URL field can link to an external website using <b>https://example.com</b>, link to an otherwise unreachable internal path using <b>/policies/privacy</b>,launch an email client using <b>mailto:[email protected]</b> or used to create a clickable phone number with <b>tel:123456789</b>'@@ -636,7 +635,6 @@ en:the Spree main menu use the code <b>category</b> or <b>promo</b> to create the containers that organize links and promotions appropriately. To learn more view the documentation by <a href='https://guides.spreecommerce.org/user/navigation/add_menu_items.html' target='_blank' class='alert-link'>clicking here</a>."type: Typeused_in: Used In- unique_code: Unique Codeyou_have_no_menus: You have no Menus, click the Add New Menu button to create your first Menu.this_link_takes_you_to_your_stores_home_page: This link takes you to your stores home page.administration: Administration