Skip to content

Commit

Permalink
Merge pull request #3221 from JuanCrg90/feature/complete-shipments-bi…
Browse files Browse the repository at this point in the history
…g-json-small-json-fields

[API] Complete Shipments Big json with small json fields
  • Loading branch information
kennyadsl authored Jun 18, 2019
2 parents d0c0616 + 598e41d commit dcff618
Showing 1 changed file with 1 addition and 10 deletions.
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

0 comments on commit dcff618

Please sign in to comment.