mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 03:30:33 +02:00
Fix DNSSEC modifitcations in DomainUpdate
This commit is contained in:
parent
766d843597
commit
33b8f031c7
1 changed files with 16 additions and 0 deletions
|
@ -17,6 +17,7 @@ module Actions
|
|||
assign_admin_contact_changes
|
||||
assign_tech_contact_changes
|
||||
assign_requested_statuses
|
||||
assign_dnssec_modifications
|
||||
|
||||
commit
|
||||
end
|
||||
|
@ -63,6 +64,21 @@ module Actions
|
|||
domain.nameservers_attributes = nameservers
|
||||
end
|
||||
|
||||
def assign_dnssec_modifications
|
||||
dnskeys = []
|
||||
params[:dns_keys].select { |dk| dk[:action] == 'rem' }.each do |key|
|
||||
dnkey = domain.dnskeys.find_by(key.except(:action))
|
||||
domain.add_epp_error('2303', nil, nil, %i[dnskeys not_found]) unless dnkey
|
||||
dnskeys << { id: dnkey.id, _destroy: 1 } if dnkey
|
||||
end
|
||||
|
||||
params[:dns_keys].select { |dk| dk[:action] == 'add' }.each do |key|
|
||||
dnskeys << key.except(:action)
|
||||
end
|
||||
|
||||
domain.dnskeys_attributes = dnskeys
|
||||
end
|
||||
|
||||
def assign_admin_contact_changes
|
||||
return unless params[:contacts]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue