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 jsonapi_serializer in version > 2.2

Damian Kaczmarczyka9a4ce7657b2
diff --git a/api/app/controllers/spree/api/v2/base_controller.rb b/api/app/controllers/spree/api/v2/base_controller.rb
index b0806b33e9..4a36894293 100644
--- a/api/app/controllers/spree/api/v2/base_controller.rb
+++ b/api/app/controllers/spree/api/v2/base_controller.rb
@@ -11,6 +11,9 @@ module Spree
rescue_from CanCan::AccessDenied, with: :access_denied
rescue_from Spree::Core::GatewayError, with: :gateway_error
rescue_from ActionController::ParameterMissing, with: :error_during_processing
+ if defined?(JSONAPI::Serializer::UnsupportedIncludeError)
+ rescue_from JSONAPI::Serializer::UnsupportedIncludeError, with: :error_during_processing
+ end
rescue_from ArgumentError, with: :error_during_processing
def content_type