This commit is contained in:
olegphenomenon 2022-10-31 10:51:27 +02:00
parent 8bbdb3c537
commit 185260907b

View file

@ -50,7 +50,6 @@ module Api
reparsed_request = reparsed_request(request.body.string) reparsed_request = reparsed_request(request.body.string)
disclosed_attributes = reparsed_request[:disclosed_attributes] disclosed_attributes = reparsed_request[:disclosed_attributes]
disclosed_attributes = disclose_attributes_for_org_registrant(disclosed_attributes)
render_disclosed_attributes_error and return if disclosed_attributes.present? && contact.org? && render_disclosed_attributes_error and return if disclosed_attributes.present? && contact.org? &&
!disclosed_attributes.include?('phone') !disclosed_attributes.include?('phone')
@ -74,15 +73,6 @@ module Api
private private
def disclose_attributes_for_org_registrant(disclosed_attributes)
return unless current_registrant_user.org?
disclosed_attributes << 'name' unless disclosed_attributes.include? 'name'
disclosed_attributes << 'email' unless disclosed_attributes.include? 'email'
disclosed_attributes
end
def representable_contact(uuid) def representable_contact(uuid)
country = current_registrant_user.country.alpha2 country = current_registrant_user.country.alpha2
contact = Contact.find_by(uuid: uuid, ident: current_registrant_user.ident, contact = Contact.find_by(uuid: uuid, ident: current_registrant_user.ident,