diff options
author | Imre Farkas <ifarkas@gitlab.com> | 2019-05-22 19:10:17 +0200 |
---|---|---|
committer | Imre Farkas <ifarkas@gitlab.com> | 2019-05-22 19:10:17 +0200 |
commit | 336db66124e7397b50bcfaf4180fe3f5753d1e8a (patch) | |
tree | c0b779d1c3636a4ba13474582dce286e163652fe | |
parent | 5ae293e33c4d6c8187543778717474a7aaccee1c (diff) | |
download | gitlab-ce-if-10137-ee_specific_lines_groups_api_refactored.tar.gz |
Refactor EE specific params override in API::Groupsif-10137-ee_specific_lines_groups_api_refactored
-rw-r--r-- | lib/api/groups.rb | 27 | ||||
-rw-r--r-- | lib/api/helpers/groups_helpers.rb | 24 |
2 files changed, 25 insertions, 26 deletions
diff --git a/lib/api/groups.rb b/lib/api/groups.rb index 6893c8c40be..ec1020c7c78 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -7,34 +7,9 @@ module API before { authenticate_non_get! } - helpers do - params :optional_params_ce do - optional :description, type: String, desc: 'The description of the group' - optional :visibility, type: String, - values: Gitlab::VisibilityLevel.string_values, - default: Gitlab::VisibilityLevel.string_level( - Gitlab::CurrentSettings.current_application_settings.default_group_visibility), - desc: 'The visibility of the group' - optional :lfs_enabled, type: Boolean, desc: 'Enable/disable LFS for the projects in this group' - optional :request_access_enabled, type: Boolean, desc: 'Allow users to request member access' - optional :share_with_group_lock, type: Boolean, desc: 'Prevent sharing a project with another group within this group' - end - - params :optional_params_ee do - end - - params :optional_update_params_ee do - end - end - - include ::API::Helpers::GroupsHelpers + helpers Helpers::GroupsHelpers helpers do - params :optional_params do - use :optional_params_ce - use :optional_params_ee - end - params :statistics_params do optional :statistics, type: Boolean, default: false, desc: 'Include project statistics' end diff --git a/lib/api/helpers/groups_helpers.rb b/lib/api/helpers/groups_helpers.rb index ae677547760..2c33d79f6c8 100644 --- a/lib/api/helpers/groups_helpers.rb +++ b/lib/api/helpers/groups_helpers.rb @@ -4,6 +4,30 @@ module API module Helpers module GroupsHelpers extend ActiveSupport::Concern + extend Grape::API::Helpers + + params :optional_params_ce do + optional :description, type: String, desc: 'The description of the group' + optional :visibility, type: String, + values: Gitlab::VisibilityLevel.string_values, + default: Gitlab::VisibilityLevel.string_level( + Gitlab::CurrentSettings.current_application_settings.default_group_visibility), + desc: 'The visibility of the group' + optional :lfs_enabled, type: Boolean, desc: 'Enable/disable LFS for the projects in this group' + optional :request_access_enabled, type: Boolean, desc: 'Allow users to request member access' + optional :share_with_group_lock, type: Boolean, desc: 'Prevent sharing a project with another group within this group' + end + + params :optional_params_ee do + end + + params :optional_update_params_ee do + end + + params :optional_params do + use :optional_params_ce + use :optional_params_ee + end end end end |