mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 03:30:33 +02:00
nameserver replacement: scope only to selected domains
This commit is contained in:
parent
ed7181e060
commit
451e1f79af
4 changed files with 30 additions and 3 deletions
|
@ -8,6 +8,7 @@ module Repp
|
|||
requires :data, type: Hash, allow_blank: false do
|
||||
requires :type, type: String, allow_blank: false
|
||||
requires :id, type: String, allow_blank: false
|
||||
optional :domains, type: Array
|
||||
requires :attributes, type: Hash, allow_blank: false do
|
||||
requires :hostname, type: String, allow_blank: false
|
||||
requires :ipv4, type: Array
|
||||
|
@ -28,8 +29,10 @@ module Repp
|
|||
ipv6: params[:data][:attributes][:ipv6],
|
||||
}
|
||||
|
||||
domains = params[:data][:domains] || []
|
||||
|
||||
begin
|
||||
affected_domains = current_user.registrar.replace_nameservers(hostname, new_attributes)
|
||||
affected_domains = current_user.registrar.replace_nameservers(hostname, new_attributes, domains)
|
||||
rescue ActiveRecord::RecordInvalid => e
|
||||
error!({ errors: e.record.errors.full_messages.map { |error| { title: error } } }, 400)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue