update the set_distribution form on the same path

and use the same method `OrdersController#set_distribution`
This commit is contained in:
Jean-Baptiste Bellet
2023-04-18 11:22:41 +02:00
parent da25dd775c
commit 88fa689cbc
2 changed files with 10 additions and 2 deletions

View File

@@ -24,7 +24,15 @@ module Spree
redirect_to spree.distribution_admin_order_path(@order)
end
def set_distribution; end
def set_distribution
return if order_params.blank?
on_update
@order.update(order_params)
@order.save
redirect_to spree.admin_order_customer_path(@order)
end
def edit
@order.shipments.map(&:refresh_rates)