From 5425f5bd04f7483c62aac269d5ad774742799676 Mon Sep 17 00:00:00 2001 From: andrea longhi Date: Thu, 7 Mar 2024 09:54:00 +0100 Subject: [PATCH] Refesh page on successful stock item update --- .../app/controllers/solidus_admin/stock_items_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/admin/app/controllers/solidus_admin/stock_items_controller.rb b/admin/app/controllers/solidus_admin/stock_items_controller.rb index 9defdea4265..1333dbe672c 100644 --- a/admin/app/controllers/solidus_admin/stock_items_controller.rb +++ b/admin/app/controllers/solidus_admin/stock_items_controller.rb @@ -30,7 +30,10 @@ def update @stock_item.stock_movements.build(quantity: quantity_adjustment, originator: current_solidus_admin_user) if @stock_item.save - redirect_to solidus_admin.stock_items_path, status: :see_other + respond_to do |format| + format.html { redirect_to solidus_admin.stock_items_path, status: :see_other } + format.turbo_stream { render turbo_stream: '' } + end else respond_to do |format| format.html { render component('stock_items/edit').new(stock_item: @stock_item, page: @page), status: :unprocessable_entity }