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.

[SD-1501] - Fix 500 Error on Adjustments Serializer. (#11440)

Matthew Kennedy9c5bf0e27c00
diff --git a/api/app/serializers/spree/api/v2/platform/adjustment_serializer.rb b/api/app/serializers/spree/api/v2/platform/adjustment_serializer.rb
index 637e2cc4e7..751c1e54a7 100644
--- a/api/app/serializers/spree/api/v2/platform/adjustment_serializer.rb
+++ b/api/app/serializers/spree/api/v2/platform/adjustment_serializer.rb
@@ -7,7 +7,12 @@ module Spree
belongs_to :order
belongs_to :adjustable, polymorphic: true
- belongs_to :source, polymorphic: true
+ belongs_to :source, polymorphic: {
+ Spree::Promotion::Actions::FreeShipping => :promotion_action,
+ Spree::Promotion::Actions::CreateAdjustment => :promotion_action,
+ Spree::Promotion::Actions::CreateItemAdjustments => :promotion_action,
+ Spree::Promotion::Actions::CreateLineItems => :promotion_action
+ }
end
end
end