2016-10-06 08:14:24 -04:00
|
|
|
require 'constraints/group_url_constrainer'
|
|
|
|
|
|
|
|
constraints(GroupUrlConstrainer.new) do
|
2016-10-16 05:49:23 -04:00
|
|
|
scope(path: ':id',
|
|
|
|
as: :group,
|
2016-11-07 11:35:14 -05:00
|
|
|
constraints: { id: Gitlab::Regex.namespace_route_regex },
|
2016-10-16 05:49:23 -04:00
|
|
|
controller: :groups) do
|
2016-10-06 08:14:24 -04:00
|
|
|
get '/', action: :show
|
2016-10-14 02:38:50 -04:00
|
|
|
patch '/', action: :update
|
|
|
|
put '/', action: :update
|
|
|
|
delete '/', action: :destroy
|
2016-10-06 08:14:24 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-11-07 08:34:25 -05:00
|
|
|
resources :groups, only: [:index, :new, :create]
|
2016-09-19 15:49:08 -04:00
|
|
|
|
2016-11-21 05:41:44 -05:00
|
|
|
scope(path: 'groups/:id',
|
|
|
|
controller: :groups,
|
|
|
|
constraints: { id: Gitlab::Regex.namespace_route_regex }) do
|
2016-11-07 08:34:25 -05:00
|
|
|
get :edit, as: :edit_group
|
|
|
|
get :issues, as: :issues_group
|
|
|
|
get :merge_requests, as: :merge_requests_group
|
|
|
|
get :projects, as: :projects_group
|
|
|
|
get :activity, as: :activity_group
|
|
|
|
end
|
2016-10-26 14:13:58 -04:00
|
|
|
|
2016-11-21 05:41:44 -05:00
|
|
|
scope(path: 'groups/:group_id',
|
|
|
|
module: :groups,
|
|
|
|
as: :group,
|
|
|
|
constraints: { group_id: Gitlab::Regex.namespace_route_regex }) do
|
2016-11-07 08:34:25 -05:00
|
|
|
resources :group_members, only: [:index, :create, :update, :destroy], concerns: :access_requestable do
|
|
|
|
post :resend_invite, on: :member
|
|
|
|
delete :leave, on: :collection
|
2016-10-05 08:21:27 -04:00
|
|
|
end
|
2016-11-07 08:34:25 -05:00
|
|
|
|
|
|
|
resource :avatar, only: [:destroy]
|
|
|
|
resources :milestones, constraints: { id: /[^\/]+/ }, only: [:index, :show, :update, :new, :create]
|
2016-11-14 17:42:44 -05:00
|
|
|
|
|
|
|
resources :labels, except: [:show], constraints: { id: /\d+/ } do
|
|
|
|
post :toggle_subscription, on: :member
|
|
|
|
end
|
2016-10-05 08:21:27 -04:00
|
|
|
end
|
2016-11-07 08:34:25 -05:00
|
|
|
|
|
|
|
# Must be last route in this file
|
2016-11-21 05:41:44 -05:00
|
|
|
get 'groups/:id' => 'groups#show', as: :group_canonical, constraints: { id: Gitlab::Regex.namespace_route_regex }
|