mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 19:48:28 +02:00
Merge remote-tracking branch 'origin/master' into 509-directo-to-gem
This commit is contained in:
commit
86889b6432
39 changed files with 298 additions and 280 deletions
|
@ -59,6 +59,7 @@ class Registrar
|
|||
def info
|
||||
authorize! :info, Depp::Domain
|
||||
@data = @domain.info(params[:domain_name]) if params[:domain_name]
|
||||
@client_holded = client_holded(@data)
|
||||
if response_ok?
|
||||
render 'info'
|
||||
else
|
||||
|
@ -153,12 +154,26 @@ class Registrar
|
|||
render json: scope.pluck(:name, :code).map { |c| { display_key: "#{c.second} #{c.first}", value: c.second } }
|
||||
end
|
||||
|
||||
def remove_hold
|
||||
authorize! :remove_hold, Depp::Domain
|
||||
return unless params[:domain_name]
|
||||
|
||||
@data = @domain.remove_hold(params)
|
||||
|
||||
flash[:alert] = @data.css('msg').text unless response_ok?
|
||||
redirect_to info_registrar_domains_url(domain_name: params[:domain_name])
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def init_domain
|
||||
@domain = Depp::Domain.new(current_user: depp_current_user)
|
||||
end
|
||||
|
||||
def client_holded(data)
|
||||
data.css('status')&.map { |element| element.attribute('s').value }
|
||||
&.any? { |status| status == DomainStatus::CLIENT_HOLD }
|
||||
end
|
||||
|
||||
def contacts
|
||||
current_registrar_user.registrar.contacts
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue