mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 03:06:14 +02:00
Process failed domains for bulk ns change
This commit is contained in:
parent
7d61eb07b0
commit
0e120d4992
5 changed files with 25 additions and 11 deletions
|
@ -5,12 +5,12 @@ module Repp
|
|||
before_action :verify_nameserver_existance, only: %i[update]
|
||||
|
||||
def update
|
||||
affected = current_user.registrar
|
||||
affected, errored = current_user.registrar
|
||||
.replace_nameservers(hostname,
|
||||
hostname_params[:data][:attributes],
|
||||
domains: domains_from_params)
|
||||
|
||||
render_success(data: data_format_for_success(affected))
|
||||
render_success(data: data_format_for_success(affected, errored))
|
||||
rescue ActiveRecord::RecordInvalid => e
|
||||
handle_errors(e.record)
|
||||
end
|
||||
|
@ -23,12 +23,13 @@ module Repp
|
|||
params[:data][:domains].map(&:downcase)
|
||||
end
|
||||
|
||||
def data_format_for_success(affected_domains)
|
||||
def data_format_for_success(affected_domains, errored_domains)
|
||||
{
|
||||
type: 'nameserver',
|
||||
id: params[:data][:attributes][:hostname],
|
||||
attributes: params[:data][:attributes],
|
||||
affected_domains: affected_domains,
|
||||
skipped_domains: errored_domains,
|
||||
}
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue