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,
|
|
|
|
constraints: { id: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ },
|
|
|
|
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-10-26 14:13:58 -04:00
|
|
|
scope constraints: { id: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ } do
|
|
|
|
resources :groups, except: [:show] do
|
|
|
|
member do
|
|
|
|
get :issues
|
|
|
|
get :merge_requests
|
|
|
|
get :projects
|
|
|
|
get :activity
|
2016-10-24 03:19:36 -04:00
|
|
|
end
|
2016-09-19 15:49:08 -04:00
|
|
|
|
2016-10-26 14:13:58 -04:00
|
|
|
scope module: :groups do
|
|
|
|
resources :group_members, only: [:index, :create, :update, :destroy], concerns: :access_requestable do
|
|
|
|
post :resend_invite, on: :member
|
|
|
|
delete :leave, on: :collection
|
|
|
|
end
|
2016-10-21 07:53:38 -04:00
|
|
|
|
2016-10-26 14:13:58 -04:00
|
|
|
resource :avatar, only: [:destroy]
|
|
|
|
resources :milestones, constraints: { id: /[^\/]+/ }, only: [:index, :show, :update, :new, :create]
|
|
|
|
|
|
|
|
resources :labels, except: [:show], constraints: { id: /\d+/ }
|
|
|
|
end
|
2016-10-05 08:21:27 -04:00
|
|
|
end
|
2016-10-26 14:13:58 -04:00
|
|
|
get 'groups/:id' => 'groups#show', as: :group_canonical
|
2016-10-05 08:21:27 -04:00
|
|
|
end
|