Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API] Complete Shipments Big json with small json fields #3221

Merged
merged 1 commit into from
Jun 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions api/app/views/spree/api/shipments/_big.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@

json.cache! [I18n.locale, shipment] do
json.(shipment, *shipment_attributes)
json.selected_shipping_rate do
if shipment.selected_shipping_rate
json.partial!("spree/api/shipping_rates/shipping_rate", shipping_rate: shipment.selected_shipping_rate)
else
json.nil!
end
end
json.partial!("spree/api/shipments/small", shipment: shipment)
json.inventory_units(shipment.inventory_units) do |inventory_unit|
json.(inventory_unit, *inventory_unit_attributes)
json.variant do
Expand Down Expand Up @@ -37,9 +31,6 @@ json.cache! [I18n.locale, shipment] do
json.ship_address do
json.partial!("spree/api/addresses/address", address: shipment.order.shipping_address)
end
json.adjustments(shipment.order.adjustments) do |adjustment|
json.partial!("spree/api/adjustments/adjustment", adjustment: adjustment)
end
json.payments(shipment.order.payments) do |payment|
json.(payment, :id, :amount, :display_amount, :state)
if payment.source
Expand Down