FIX: Prepend the user id before username in admin user routes

This commit is contained in:
Erick Guan
2015-09-26 15:56:36 +02:00
parent b2ffaa0822
commit 35142847ba
9 changed files with 16 additions and 17 deletions

View File

@ -73,8 +73,7 @@ Discourse::Application.routes.draw do
get "groups/:type" => "groups#show", constraints: AdminConstraint.new
get "groups/:type/:id" => "groups#show", constraints: AdminConstraint.new
get "users/:id.json" => 'users#show' , id: USERNAME_ROUTE_FORMAT, defaults: {format: 'json'}
resources :users, id: USERNAME_ROUTE_FORMAT do
resources :users, id: USERNAME_ROUTE_FORMAT, except: [:show] do
collection do
get "list/:query" => "users#index"
get "ip-info" => "users#ip_info"
@ -109,6 +108,8 @@ Discourse::Application.routes.draw do
get "tl3_requirements"
put "anonymize"
end
get "users/:id.json" => 'users#show', defaults: {format: 'json'}
get 'users/:id/:username' => 'users#show'
post "users/sync_sso" => "users#sync_sso", constraints: AdminConstraint.new