Merge branch '1832-registrar-prefix-on-contact-info-and-check-requests' of https://github.com/internetee/registry into 1832-registrar-prefix-on-contact-info-and-check-requests

This commit is contained in:
Karl Erik Õunapuu 2021-02-10 13:29:55 +02:00
commit 1960164223
No known key found for this signature in database
GPG key ID: C9DD647298A34764
2 changed files with 6 additions and 5 deletions

View file

@ -45,9 +45,9 @@ class Epp::Contact < Contact
def check_availability(codes, reg:)
codes = [codes] if codes.is_a?(String)
res = []
codes.map { |c| c.strip.upcase }.map { |c| c.include?(':') ? c : "#{reg}:#{c}" }.each do |x|
codes.map { |c| c.include?(':') ? c : "#{reg}:#{c}" }.map { |c| c.strip.upcase }.each do |x|
c = find_by_epp_code(x)
res << c ? { code: c.code, avail: 0, reason: 'in use' } : { code: x, avail: 1 }
res << (c ? { code: c.code, avail: 0, reason: 'in use' } : { code: x, avail: 1 })
end
res