mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 01:33:36 +02:00
Allow removing contacts one by one #2596
This commit is contained in:
parent
bd18cc0a85
commit
573349d0b6
1 changed files with 11 additions and 2 deletions
|
@ -192,10 +192,10 @@ module Depp
|
|||
end
|
||||
|
||||
def construct_edit_hash(domain_params, old_domain_params)
|
||||
contacts = create_contacts_hash(domain_params) - create_contacts_hash(old_domain_params)
|
||||
contacts = array_difference(create_contacts_hash(domain_params), create_contacts_hash(old_domain_params))
|
||||
add_anon = contacts
|
||||
|
||||
contacts = create_contacts_hash(old_domain_params) - create_contacts_hash(domain_params)
|
||||
contacts = array_difference(create_contacts_hash(old_domain_params), create_contacts_hash(domain_params))
|
||||
rem_anon = contacts
|
||||
|
||||
if domain_params[:registrant] != old_domain_params[:registrant]
|
||||
|
@ -284,6 +284,15 @@ module Depp
|
|||
pubKey: { value: key_data_params['public_key'] }
|
||||
}
|
||||
end
|
||||
|
||||
def array_difference(x, y)
|
||||
ret = x.dup
|
||||
y.each do |element|
|
||||
index = ret.index(element)
|
||||
ret.delete_at(index) if index
|
||||
end
|
||||
ret
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue