mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 09:21:43 +02:00
Domain checking for multiple domains
This commit is contained in:
parent
7ec19c2804
commit
8f131c2fe4
6 changed files with 71 additions and 10 deletions
|
@ -1,21 +1,17 @@
|
|||
module Epp::DomainsHelper
|
||||
def create_domain
|
||||
domain = Domain.create!(domain_params)
|
||||
domain = Domain.create!(domain_create_params)
|
||||
render '/epp/domains/create'
|
||||
end
|
||||
|
||||
def check_domain
|
||||
cp = command_params_for('check')
|
||||
|
||||
@domain = cp[:name]
|
||||
@avail = Domain.find_by(name: @domain) ? '0' : '1'
|
||||
|
||||
@domains = Domain.check_availability(domain_check_params[:names])
|
||||
render '/epp/domains/check'
|
||||
end
|
||||
|
||||
### HELPER METHODS ###
|
||||
|
||||
def domain_params
|
||||
def domain_create_params
|
||||
cp = command_params_for('create')
|
||||
{
|
||||
name: cp[:name],
|
||||
|
@ -26,4 +22,9 @@ module Epp::DomainsHelper
|
|||
auth_info: cp[:authInfo]
|
||||
}
|
||||
end
|
||||
|
||||
def domain_check_params
|
||||
node_set = parsed_frame.css('epp command check check name')
|
||||
node_set.inject({names: []}){ |hash, obj| hash[:names] << obj.text; hash }
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue