mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
update the set_distribution form on the same path
and use the same method `OrdersController#set_distribution`
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
= render 'spree/shared/error_messages', :target => @order
|
||||
|
||||
%div{"ng-app" => "admin.orders", "ng-controller" => "orderCtrl"}
|
||||
= form_for @order, url: admin_order_url(@order), method: :put do |f|
|
||||
= form_for @order, url: distribution_admin_order_path(@order), method: :put do |f|
|
||||
= render 'spree/admin/orders/_form/distribution_fields'
|
||||
-# This param passed to stop validation error in next page due to no line items in order yet:
|
||||
= hidden_field_tag 'suppress_error_msg', "true"
|
||||
|
||||
Reference in New Issue
Block a user