Skip to content

Commit

Permalink
Call empty only on incomplete orders
Browse files Browse the repository at this point in the history
Code fails with a 500 on admin because of the order shipping status.
The change triggers @order.empty! only when the order is incomplete.

Co-authored-by: An Stewart <[email protected]>
  • Loading branch information
2 people authored and nvandoorn committed Aug 14, 2024
1 parent 2ae2bfd commit 4a761b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/app/controllers/spree/api/orders_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ def create

def empty
authorize! :update, @order, order_token
@order.empty!

@order.empty! unless @order.complete?

respond_with(@order, default_template: :show)
end

Expand Down

0 comments on commit 4a761b8

Please sign in to comment.