From 9119c36348068c3f1be112a0f59ca9f1215b320c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Javier=20L=C3=B3pez?= Date: Thu, 14 Dec 2017 12:48:01 +0100 Subject: Resolving conflict --- lib/api/groups.rb | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/lib/api/groups.rb b/lib/api/groups.rb index a0f85c5bc3d..573382738ce 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -25,24 +25,7 @@ module API optional :statistics, type: Boolean, default: false, desc: 'Include project statistics' end - def present_groups(groups, options = {}) - 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 + params :group_list_params do use :statistics_params 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' @@ -76,12 +59,11 @@ module API paginate(projects) end - def present_groups(params, groups) - options = { + def present_groups(groups, options = {}) + options = options.reverse_merge( with: Entities::Group, - current_user: current_user, - statistics: params[:statistics] && current_user.admin? - } + current_user: current_user + ) groups = groups.with_statistics if options[:statistics] present paginate(groups), options -- cgit v1.2.1