gitlab-org--gitlab-foss/app/services/gpg_keys/create_service.rb

19 lines
337 B
Ruby

# frozen_string_literal: true
module GpgKeys
class CreateService < Keys::BaseService
def execute
key = create(params)
notification_service.new_gpg_key(key) if key.persisted?
key
end
private
def create(params)
user.gpg_keys.create(params)
end
end
end
GpgKeys::CreateService.prepend_mod