mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-17 04:34:24 +00:00
Copy admin/orders#edit from Spree controller
This method needs to be updated to use custom order advance logic in service.
This commit is contained in:
@@ -27,6 +27,18 @@ Spree::Admin::OrdersController.class_eval do
|
||||
# within the page then fetches the data it needs from Api::OrdersController
|
||||
end
|
||||
|
||||
def edit
|
||||
@order.shipments.map &:refresh_rates
|
||||
|
||||
# Transition as far as we can go
|
||||
while @order.next; end
|
||||
|
||||
# The payment step shows an error of 'No pending payments'
|
||||
# Clearing the errors from the order object will stop this error
|
||||
# appearing on the edit page where we don't want it to.
|
||||
@order.errors.clear
|
||||
end
|
||||
|
||||
# Re-implement spree method so that it redirects to edit instead of rendering edit
|
||||
# This allows page reloads while adding variants to the order (/edit), without being redirected to customer details page (/update)
|
||||
def update
|
||||
|
||||
Reference in New Issue
Block a user