From 598e41dae84879b30c153a1e6fc89c081c868c4f Mon Sep 17 00:00:00 2001 From: Juan Carlos Ruiz Date: Fri, 14 Jun 2019 23:29:17 -0500 Subject: [PATCH] Complete Shipments Big json with small json fields Big json should be a super set of Small json. This adds the api/app/views/spree/api/shipments/_smaill.json.jbuilder partial inside api/app/views/spree/api/shipments/_big.json.jbuilder file and remove the duplicated fields. --- api/app/views/spree/api/shipments/_big.json.jbuilder | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/api/app/views/spree/api/shipments/_big.json.jbuilder b/api/app/views/spree/api/shipments/_big.json.jbuilder index 6e64913ae9c..6f7495af402 100644 --- a/api/app/views/spree/api/shipments/_big.json.jbuilder +++ b/api/app/views/spree/api/shipments/_big.json.jbuilder @@ -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 @@ -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