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.

Fix change from unique_code to location in menus API

Matthew Kennedyd4c45414a94c
diff --git a/api/config/routes.rb b/api/config/routes.rb
index 4d2e6ae4e5..2aaeca5dc4 100644
--- a/api/config/routes.rb
+++ b/api/config/routes.rb
@@ -165,7 +165,7 @@ Spree::Core::Engine.add_routes do
get '/stores/:code', to: 'stores#show', as: :store
resources :menus, only: %i[index]
- get '/menus/:unique_code', to: 'menus#show', as: :menu
+ get '/menus/:location', to: 'menus#show', as: :menu
end
namespace :platform do
diff --git a/core/app/finders/spree/menus/find.rb b/core/app/finders/spree/menus/find.rb
index 2090312ea8..d8f6ad61d4 100644
--- a/core/app/finders/spree/menus/find.rb
+++ b/core/app/finders/spree/menus/find.rb
@@ -2,7 +2,7 @@ module Spree
module Menus
class Find < ::Spree::BaseFinder
def 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?
scope
end
diff --git a/core/config/locales/en.yml b/core/config/locales/en.yml
index f6fb07bcdb..d405ae6650 100644
--- a/core/config/locales/en.yml
+++ b/core/config/locales/en.yml
@@ -625,7 +625,6 @@ en:
menus: Menus
menu_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: Subtitle
url_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: Type
used_in: Used In
- unique_code: Unique Code
you_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