Merge pull request #932 from internetee/improve-registrant-area

Improve registrant area
This commit is contained in:
Timo Võhmar 2018-09-19 14:06:11 +03:00 committed by GitHub
commit 64d8be029c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 246 additions and 84 deletions

View file

@ -1,5 +1,6 @@
class Registrant::ContactsController < RegistrantController
helper_method :domain_ids
helper_method :domain
def show
@contact = Contact.where(id: contacts).find_by(id: params[:id])
@ -25,4 +26,19 @@ class Registrant::ContactsController < RegistrantController
BusinessRegistryCache.fetch_by_ident_and_cc(ident, ident_cc).associated_domain_ids
end
end
end
def domain
current_user_domains.find(params[:domain_id])
end
def current_user_domains
ident_cc, ident = current_registrant_user.registrant_ident.split '-'
begin
BusinessRegistryCache.fetch_associated_domains ident, ident_cc
rescue Soap::Arireg::NotAvailableError => error
flash[:notice] = I18n.t(error.json[:message])
Rails.logger.fatal("[EXCEPTION] #{error.to_s}")
current_registrant_user.domains
end
end
end