mirror of
https://github.com/internetee/registry.git
synced 2025-05-19 18:59:38 +02:00
18 lines
No EOL
535 B
Ruby
18 lines
No EOL
535 B
Ruby
class Registrant::ContactsController < RegistrantController
|
|
|
|
def show
|
|
@contact = Contact.where(id: contacts).find(params[:id])
|
|
authorize! :read, @contact
|
|
end
|
|
|
|
def contacts
|
|
ident_cc, ident = @current_user.registrant_ident.to_s.split '-'
|
|
begin
|
|
BusinessRegistryCache.fetch_by_ident_and_cc(ident, ident_cc).associated_contacts
|
|
rescue Soap::Arireg::NotAvailableError => error
|
|
flash[:notice] = I18n.t(error.json[:message])
|
|
Rails.logger.fatal("[EXCEPTION] #{error.to_s}")
|
|
[]
|
|
end
|
|
end
|
|
end |