mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 17:28:18 +02:00
Domain has many admin and technical contacts now
This commit is contained in:
parent
22baafab6d
commit
8bff2fb34c
8 changed files with 82 additions and 20 deletions
|
@ -1,13 +1,14 @@
|
|||
module Epp::DomainsHelper
|
||||
def create_domain
|
||||
@domain = Domain.new(domain_create_params)
|
||||
@domain.create_contacts(domain_contacts)
|
||||
|
||||
if @domain.save
|
||||
render '/epp/domains/create'
|
||||
else
|
||||
handle_domain_name_errors
|
||||
render '/epp/error'
|
||||
Domain.transaction do
|
||||
if @domain.save && @domain.attach_contacts(domain_contacts)
|
||||
render '/epp/domains/create'
|
||||
else
|
||||
handle_domain_name_errors
|
||||
render '/epp/error'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -37,11 +38,11 @@ module Epp::DomainsHelper
|
|||
|
||||
res = {tech: [], admin: []}
|
||||
parsed_frame.css('contact[type="tech"]').each do |x|
|
||||
res[:tech] << Hash.from_xml(x.to_s)
|
||||
res[:tech] << Hash.from_xml(x.to_s).with_indifferent_access
|
||||
end
|
||||
|
||||
parsed_frame.css('contact[type="admin"]').each do |x|
|
||||
res[:admin] << Hash.from_xml(x.to_s)
|
||||
res[:admin] << Hash.from_xml(x.to_s).with_indifferent_access
|
||||
end
|
||||
|
||||
res
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue