mirror of
https://github.com/internetee/registry.git
synced 2025-06-06 04:37:30 +02:00
Fix contact code check
This commit is contained in:
parent
c7b4045018
commit
0617ef9d7d
2 changed files with 3 additions and 2 deletions
|
@ -14,7 +14,7 @@ module Epp
|
|||
authorize! :check, Epp::Contact
|
||||
|
||||
ids = params[:parsed_frame].css('id').map(&:text)
|
||||
@results = Epp::Contact.check_availability(ids)
|
||||
@results = Epp::Contact.check_availability(ids, reg: current_user.registrar.code)
|
||||
render_epp_response '/epp/contacts/check'
|
||||
end
|
||||
|
||||
|
|
|
@ -42,8 +42,9 @@ class Epp::Contact < Contact
|
|||
)
|
||||
end
|
||||
|
||||
def check_availability(codes)
|
||||
def check_availability(codes, reg:)
|
||||
codes = [codes] if codes.is_a?(String)
|
||||
codes = codes.map { |c| c.include?(':') ? c : "#{reg}:#{c}" }
|
||||
|
||||
res = []
|
||||
codes.each do |x|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue