diff --git a/app/controllers/admin/products_v3_controller.rb b/app/controllers/admin/products_v3_controller.rb index 52d26bd924..b4968e0a2f 100644 --- a/app/controllers/admin/products_v3_controller.rb +++ b/app/controllers/admin/products_v3_controller.rb @@ -32,19 +32,19 @@ module Admin end def destroy - @product = ProductScopeQuery.new( + @record = ProductScopeQuery.new( spree_current_user, { id: params[:id] } ).find_product - if @product.destroy + if @record.destroy flash[:success] = I18n.t('admin.products_v3.delete_product.success') else flash[:error] = I18n.t('admin.products_v3.delete_product.error') end respond_with do |format| - format.turbo_stream + format.turbo_stream { render :destroy_product_variant } end # using flash with turbo stream doesn't clear it because the page is not refreshed. diff --git a/app/views/admin/products_v3/destroy.turbo_stream.haml b/app/views/admin/products_v3/destroy.turbo_stream.haml deleted file mode 100644 index f517ebc6cd..0000000000 --- a/app/views/admin/products_v3/destroy.turbo_stream.haml +++ /dev/null @@ -1,2 +0,0 @@ -= turbo_stream.remove dom_id(@product) -= render partial: "admin/shared/flashes", locals: { flashes: flash } if defined? flash \ No newline at end of file