diff options
Diffstat (limited to 'app/graphql/mutations/organizations/create.rb')
-rw-r--r-- | app/graphql/mutations/organizations/create.rb | 15 |
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 |