diff options
Diffstat (limited to 'app/graphql/mutations/alert_management/http_integration/create.rb')
-rw-r--r-- | app/graphql/mutations/alert_management/http_integration/create.rb | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/app/graphql/mutations/alert_management/http_integration/create.rb b/app/graphql/mutations/alert_management/http_integration/create.rb index ddb75e66bb4..ff165d7f302 100644 --- a/app/graphql/mutations/alert_management/http_integration/create.rb +++ b/app/graphql/mutations/alert_management/http_integration/create.rb @@ -10,32 +10,41 @@ module Mutations argument :project_path, GraphQL::ID_TYPE, required: true, - description: 'The project to create the integration in' + description: 'The project to create the integration in.' argument :name, GraphQL::STRING_TYPE, required: true, - description: 'The name of the integration' + description: 'The name of the integration.' argument :active, GraphQL::BOOLEAN_TYPE, required: true, - description: 'Whether the integration is receiving alerts' + description: 'Whether the integration is receiving alerts.' def resolve(args) - project = authorized_find!(full_path: args[:project_path]) + @project = authorized_find!(full_path: args[:project_path]) response ::AlertManagement::HttpIntegrations::CreateService.new( project, current_user, - args.slice(:name, :active) + http_integration_params(args) ).execute end private + attr_reader :project + def find_object(full_path:) resolve_project(full_path: full_path) end + + # overriden in EE + def http_integration_params(args) + args.slice(:name, :active) + end end end end end + +Mutations::AlertManagement::HttpIntegration::Create.prepend_if_ee('::EE::Mutations::AlertManagement::HttpIntegration::Create') |