Skip to content

Commit

Permalink
Refesh page on successful stock item update
Browse files Browse the repository at this point in the history
  • Loading branch information
spaghetticode committed Mar 7, 2024
1 parent 751a541 commit 5425f5b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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: '<turbo-stream action="refresh" />' }
end
else
respond_to do |format|
format.html { render component('stock_items/edit').new(stock_item: @stock_item, page: @page), status: :unprocessable_entity }
Expand Down

0 comments on commit 5425f5b

Please sign in to comment.