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 issues with wished product controller.

Matthew Kennedyae76ab0f55d8
diff --git a/api/app/controllers/spree/api/v2/storefront/wished_products_controller.rb b/api/app/controllers/spree/api/v2/storefront/wished_products_controller.rb
index 6fb21c7f9c..fca1535c74 100644
--- a/api/app/controllers/spree/api/v2/storefront/wished_products_controller.rb
+++ b/api/app/controllers/spree/api/v2/storefront/wished_products_controller.rb
@@ -2,7 +2,7 @@ module Spree
module Api
module V2
module Storefront
- class WishedProductsController < ::Spree::Api::V2::BaseController
+ class WishedProductsController < ::Spree::Api::V2::ResourceController
def create
spree_authorize! :create, Spree::WishedProduct
@@ -52,7 +52,7 @@ module Spree
end
def wishlist
- @wishlist ||= Spree::Wishlist.find_by!(access_hash: params[:wishlist_id])
+ @wishlist ||= Spree::Wishlist.find_by!(token: params[:wishlist_id])
end
def wished_product_attributes
diff --git a/api/app/controllers/spree/api/v2/storefront/wishlists_controller.rb b/api/app/controllers/spree/api/v2/storefront/wishlists_controller.rb
index 8daa4285a7..7acad9933c 100644
--- a/api/app/controllers/spree/api/v2/storefront/wishlists_controller.rb
+++ b/api/app/controllers/spree/api/v2/storefront/wishlists_controller.rb
@@ -2,7 +2,7 @@ module Spree
module Api
module V2
module Storefront
- class WishlistsController < ::Spree::Api::V2::BaseController
+ class WishlistsController < ::Spree::Api::V2::ResourceController
include Spree::Api::V2::CollectionOptionsHelpers
before_action :require_spree_current_user