2018-11-18 11:00:15 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
module GpgKeys
|
|
|
|
class CreateService < Keys::BaseService
|
|
|
|
def execute
|
2021-09-30 23:02:18 +05:30
|
|
|
key = create(params)
|
2018-03-17 18:26:18 +05:30
|
|
|
notification_service.new_gpg_key(key) if key.persisted?
|
|
|
|
key
|
|
|
|
end
|
2021-09-30 23:02:18 +05:30
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def create(params)
|
|
|
|
user.gpg_keys.create(params)
|
|
|
|
end
|
2018-03-17 18:26:18 +05:30
|
|
|
end
|
|
|
|
end
|
2021-09-30 23:02:18 +05:30
|
|
|
|
|
|
|
GpgKeys::CreateService.prepend_mod
|