mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 01:35:10 +02:00
Refactor EppDomain to Epp::Domain
This commit is contained in:
parent
2c35617745
commit
d558b2eed9
7 changed files with 19 additions and 49 deletions
|
@ -1,30 +0,0 @@
|
|||
module EppParser
|
||||
def domain_rem_params
|
||||
|
||||
|
||||
{
|
||||
nameservers_attributes: to_destroy
|
||||
}
|
||||
end
|
||||
|
||||
def nameservers_attributes
|
||||
ns_list = Epp::EppDomain.parse_nameservers_from_frame(params[:parsed_frame])
|
||||
|
||||
to_destroy = []
|
||||
ns_list.each do |ns_attrs|
|
||||
nameserver = @domain.nameservers.where(ns_attrs).try(:first)
|
||||
if nameserver.blank?
|
||||
epp_errors << {
|
||||
code: '2303',
|
||||
msg: I18n.t('nameserver_not_found'),
|
||||
value: { obj: 'hostAttr', val: ns_attrs[:hostname] }
|
||||
}
|
||||
else
|
||||
to_destroy << {
|
||||
id: nameserver.id,
|
||||
_destroy: 1
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue