summaryrefslogtreecommitdiff
path: root/config/routes.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-06-01 18:17:03 +0200
committerRémy Coutable <remy@rymai.me>2016-06-14 13:07:26 +0200
commitd75edf1a9854b2ab609c7d3acf5eee1ca89e8db9 (patch)
treef727b323c1ce9fd4419aea65c8c4aac4f07570b0 /config/routes.rb
parentd71fbe0dbdb3b7aba6f71e6d3d50daaa890769e9 (diff)
downloadgitlab-ce-d75edf1a9854b2ab609c7d3acf5eee1ca89e8db9.tar.gz
Factorize access request routes into a new :access_requestable route concern
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'config/routes.rb')
-rw-r--r--config/routes.rb19
1 files changed, 5 insertions, 14 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 2eccb19deff..f5574fb99a5 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -32,7 +32,7 @@ Rails.application.routes.draw do
concern :access_requestable do
post :request_access, on: :collection
- post :approve_access_request_access_request, on: :member
+ post :approve_access_request, on: :member
end
namespace :ci do
@@ -414,16 +414,9 @@ Rails.application.routes.draw do
end
scope module: :groups do
- resources :group_members, only: [:index, :create, :update, :destroy] do
- collection do
- delete :leave
- post :request_access
- end
-
- member do
- post :resend_invite
- post :approve
- end
+ resources :group_members, only: [:index, :create, :update, :destroy], concerns: :access_requestable do
+ post :resend_invite, on: :member
+ delete :leave, on: :collection
end
resource :avatar, only: [:destroy]
@@ -777,10 +770,9 @@ Rails.application.routes.draw do
end
end
- resources :project_members, except: [:new, :edit], constraints: { id: /[a-zA-Z.\/0-9_\-#%+]+/ } do
+ resources :project_members, except: [:new, :edit], constraints: { id: /[a-zA-Z.\/0-9_\-#%+]+/ }, concerns: :access_requestable do
collection do
delete :leave
- post :request_access
# Used for import team
# from another project
@@ -790,7 +782,6 @@ Rails.application.routes.draw do
member do
post :resend_invite
- post :approve
end
end