mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
Add failure block to create respond_override for creating products
This commit is contained in:
@@ -5,13 +5,17 @@ Spree::Admin::ProductsController.class_eval do
|
||||
|
||||
respond_to :json, :only => :clone
|
||||
|
||||
respond_override create: { html: { success: lambda {
|
||||
if params[:button] == "add_another"
|
||||
redirect_to new_admin_product_path
|
||||
else
|
||||
redirect_to '/admin/products/bulk_edit'
|
||||
end
|
||||
} } }
|
||||
respond_override create: { html: {
|
||||
success: lambda {
|
||||
if params[:button] == "add_another"
|
||||
redirect_to new_admin_product_path
|
||||
else
|
||||
redirect_to '/admin/products/bulk_edit'
|
||||
end
|
||||
},
|
||||
failure: lambda {
|
||||
render :new
|
||||
} } }
|
||||
#respond_override :clone => { :json => {:success => lambda { redirect_to bulk_index_admin_products_url+"?q[id_eq]=#{@new.id}" } } }
|
||||
|
||||
def product_distributions
|
||||
|
||||
Reference in New Issue
Block a user