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.rb22
1 files changed, 2 insertions, 20 deletions
diff --git a/app/graphql/mutations/organizations/create.rb b/app/graphql/mutations/organizations/create.rb
index 2e26184b9fe..bea75d6560a 100644
--- a/app/graphql/mutations/organizations/create.rb
+++ b/app/graphql/mutations/organizations/create.rb
@@ -2,16 +2,11 @@
module Mutations
module Organizations
- class Create < BaseMutation
+ class Create < Base
graphql_name 'OrganizationCreate'
authorize :create_organization
- field :organization,
- ::Types::Organizations::OrganizationType,
- null: true,
- description: 'Organization created.'
-
argument :name, GraphQL::Types::String,
required: true,
description: 'Name for the organization.'
@@ -20,29 +15,16 @@ 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: create_params(args)
+ 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