app/controllers/spree/api/v2/storefront/checkout_controller.rb in spree_api-4.0.9 vs app/controllers/spree/api/v2/storefront/checkout_controller.rb in spree_api-4.1.0.rc1
- old
+ new
@@ -63,15 +63,11 @@
end
def shipping_rates
result = shipping_rates_service.call(order: spree_current_order)
- if result.success?
- render_serialized_payload { serialize_shipping_rates(result.value) }
- else
- render_error_payload(result.error)
- end
+ render_serialized_payload { serialize_shipping_rates(result.value) }
end
def payment_methods
render_serialized_payload { serialize_payment_methods(spree_current_order.available_payment_methods) }
end
@@ -123,10 +119,11 @@
end
def serialize_shipping_rates(shipments)
shipping_rates_serializer.new(
shipments,
- include: [:shipping_rates, :stock_location]
+ include: [:shipping_rates],
+ params: { show_rates: true }
).serializable_hash
end
end
end
end