Fix code attribute

This commit is contained in:
Thiago Youssef 2022-05-04 16:15:56 +03:00
parent 750bf0821c
commit 0484626fb8
3 changed files with 4 additions and 3 deletions

View file

@ -120,7 +120,7 @@ module Actions
contact = Contact.find_by(code: contact_code)
arr = admin ? @admin_contacts : @tech_contacts
if contact
arr << { contact_id: contact.id }
arr << { contact_id: contact.id, contact_code: contact.code }
else
domain.add_epp_error('2303', 'contact', contact_code, %i[domain_contacts not_found])
end

View file

@ -125,7 +125,7 @@ module Actions
end
def start_validate_email(props)
contact = Contact.find(props[0][:contact_id])
contact = Contact.find_by(code: props[0][:contact_code])
return if contact.nil?
@ -205,7 +205,7 @@ module Actions
domain.add_epp_error('2306', 'contact', code,
%i[domain_contacts admin_contact_can_be_only_private_person])
else
add ? { contact_id: obj.id } : { id: obj.id, _destroy: 1 }
add ? { contact_id: obj.id, contact_code: obj.code } : { id: obj.id, _destroy: 1 }
end
end

View file

@ -10,6 +10,7 @@ class DomainContact < ApplicationRecord
after_destroy :update_contact
attr_accessor :value_typeahead
attr_writer :contact_code
self.ignored_columns = %w[legacy_domain_id legacy_contact_id]