BigW Consortium Gitlab

Resolving conflict

parent ebfe269e
...@@ -25,24 +25,7 @@ module API ...@@ -25,24 +25,7 @@ module API
optional :statistics, type: Boolean, default: false, desc: 'Include project statistics' optional :statistics, type: Boolean, default: false, desc: 'Include project statistics'
end end
def present_groups(groups, options = {}) params :group_list_params do
options = options.reverse_merge(
with: Entities::Group,
current_user: current_user
)
groups = groups.with_statistics if options[:statistics]
present paginate(groups), options
end
end
resource :groups do
include CustomAttributesEndpoints
desc 'Get a groups list' do
success Entities::Group
end
params do
use :statistics_params use :statistics_params
optional :skip_groups, type: Array[Integer], desc: 'Array of group ids to exclude from list' optional :skip_groups, type: Array[Integer], desc: 'Array of group ids to exclude from list'
optional :all_available, type: Boolean, desc: 'Show all group that you have access to' optional :all_available, type: Boolean, desc: 'Show all group that you have access to'
...@@ -76,12 +59,11 @@ module API ...@@ -76,12 +59,11 @@ module API
paginate(projects) paginate(projects)
end end
def present_groups(params, groups) def present_groups(groups, options = {})
options = { options = options.reverse_merge(
with: Entities::Group, with: Entities::Group,
current_user: current_user, current_user: current_user
statistics: params[:statistics] && current_user.admin? )
}
groups = groups.with_statistics if options[:statistics] groups = groups.with_statistics if options[:statistics]
present paginate(groups), options present paginate(groups), options
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment