Skip to content

Commit

Permalink
Include action to render orders/new component
Browse files Browse the repository at this point in the history
  • Loading branch information
rainerdema committed Oct 12, 2023
1 parent 7a0578d commit 5a6eefe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions admin/app/controllers/solidus_admin/orders_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,19 @@ def index
format.html { render component('orders/index').new(page: @page) }
end
end

def new
@order = Spree::Order.new(
{
created_by_id: spree_current_user.try(:id),
frontend_viewable: false,
store_id: current_store.try(:id)
}
)

respond_to do |format|
format.html { render component('orders/new').new(order: @order) }
end
end
end
end
2 changes: 1 addition & 1 deletion admin/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
put :activate
end
end
resources :orders, only: :index
resources :orders, only: [:index, :new, :create]
end

0 comments on commit 5a6eefe

Please sign in to comment.