Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/mutations/organizations/create.rb')
-rw-r--r--app/graphql/mutations/organizations/create.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/app/graphql/mutations/organizations/create.rb b/app/graphql/mutations/organizations/create.rb
index 0d1b204a4c1..2e26184b9fe 100644
--- a/app/graphql/mutations/organizations/create.rb
+++ b/app/graphql/mutations/organizations/create.rb
@@ -20,16 +20,29 @@ module Mutations
required: true,
description: 'Path for the organization.'
+ argument :description, GraphQL::Types::String,
+ required: false,
+ description: 'Description of the organization.'
+
def resolve(args)
authorize!(:global)
result = ::Organizations::CreateService.new(
current_user: current_user,
- params: args
+ params: create_params(args)
).execute
{ organization: result.payload, errors: result.errors }
end
+
+ private
+
+ def create_params(params)
+ return params unless params.key?(:description)
+
+ params[:organization_detail_attributes] = { description: params.delete(:description) }
+ params
+ end
end
end
end