Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the /admin/orders/:number route #4886

Merged
merged 1 commit into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions backend/app/controllers/spree/admin/orders_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ class OrdersController < Spree::Admin::BaseController
rescue_from Spree::Order::InsufficientStock, with: :insufficient_stock_error
respond_to :html

def show
redirect_to action: :edit
end

def index
params[:q] ||= {}
params[:q][:completed_at_not_null] ||= '1' if Spree::Config[:show_only_complete_orders_by_default]
Expand Down
2 changes: 1 addition & 1 deletion backend/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

delete '/product_properties/:id', to: "product_properties#destroy", as: :product_property

resources :orders, except: [:show] do
resources :orders do
member do
get :cart
put :advance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@
end
end

describe "#show" do
it "redirects to :edit" do
get :show, params: { id: order.number }
expect(response).to redirect_to(spree.edit_admin_order_path(order.number))
end
end

describe '#advance' do
subject do
put :advance, params: { id: order.number }
Expand Down