[API] empty cart endpoint raises 500 error with shipped order #4438
Labels
good first issue
Wanted, but lacking time to work on it and might be a good fit for a first contribution
type:bug
Error, flaw or fault
Solidus Version:
all, including master
How to reproduce
Trying to
empty
a shipped order via API raises a 500 error, which is something we should try to avoid.This can be easily demonstrated in the admin area:
Cart
tab, add an item to a new order, and keep this browser window as it is, we'll get back to it later;Cart
browser window and click theEmpty Cart
button. Web developer tools will show a 500 error, and no message is presented to the user.Context
This is the method definition from the API orders controller:
@order.empty!
tries to reset the cart by destroying the associated records, but shipped shipments cannot be destroyed. The error bubbles up to the controller, where it's not handled.The text was updated successfully, but these errors were encountered: