Use OrderContents in BulkLineItemsController

We should move towards *all* operations on an order's line items being done exclusively through this service.
This commit is contained in:
Matt-Yorkley
2021-05-11 11:28:55 +01:00
parent 632f4228f0
commit 23910dbab4
2 changed files with 1 additions and 4 deletions

View File

@@ -49,7 +49,7 @@ module Admin
load_line_item
authorize! :update, order
@line_item.destroy
order.contents.remove(@line_item.variant, @line_item.quantity)
render body: nil, status: :no_content # No Content, does not trigger ng resource auto-update
end

View File

@@ -378,9 +378,6 @@ describe Admin::BulkLineItemsController, type: :controller do
expect(order.included_tax_total).to eq 1.22
expect(order.payment_state).to eq "paid"
expect(order).to receive(:update_order!).at_least(:once).and_call_original
expect(order).to receive(:create_tax_charge!).at_least(:once).and_call_original
spree_delete :destroy, params
order.reload