diff --git a/app/controllers/api/v1/registrant/contacts_controller.rb b/app/controllers/api/v1/registrant/contacts_controller.rb index 7d8dbfac1..10f9abacf 100644 --- a/app/controllers/api/v1/registrant/contacts_controller.rb +++ b/app/controllers/api/v1/registrant/contacts_controller.rb @@ -91,7 +91,7 @@ module Api private def current_user_contacts - current_registrant_user.contacts + current_registrant_user.contacts(representable: false) rescue CompanyRegister::NotAvailableError current_registrant_user.direct_contacts end diff --git a/app/models/contact.rb b/app/models/contact.rb index 7ed2d9031..9dc1e34a2 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -210,11 +210,11 @@ class Contact < ApplicationRecord ) end - def registrant_user_contacts(registrant_user, representment: true) + def registrant_user_contacts(registrant_user, representable: true) represented_contacts = registrant_user_direct_contacts(registrant_user) .or(registrant_user_company_contacts(registrant_user)) - return represented_contacts if representment + return represented_contacts if representable represented_contacts.or(registrant_user_indirect_contacts(registrant_user)) end diff --git a/app/models/registrant_user.rb b/app/models/registrant_user.rb index c631c5c8e..7bd84d5dd 100644 --- a/app/models/registrant_user.rb +++ b/app/models/registrant_user.rb @@ -22,8 +22,8 @@ class RegistrantUser < User citizen_country_code: country.alpha3) end - def contacts(representment: true) - Contact.registrant_user_contacts(self, representment: representment) + def contacts(representable: true) + Contact.registrant_user_contacts(self, representable: representable) end def direct_contacts