From 7939c5065dfe8234897af96ed3bc274f824d0b3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergei=20Ts=C3=B5ganov?= Date: Thu, 7 Jul 2022 13:45:20 +0300 Subject: [PATCH] Updaded api user return data --- app/controllers/repp/v1/accounts_controller.rb | 2 +- app/controllers/repp/v1/domains/admin_contacts_controller.rb | 2 +- app/models/api_user.rb | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/repp/v1/accounts_controller.rb b/app/controllers/repp/v1/accounts_controller.rb index 301bed95f..7db2a3275 100644 --- a/app/controllers/repp/v1/accounts_controller.rb +++ b/app/controllers/repp/v1/accounts_controller.rb @@ -143,7 +143,7 @@ module Repp arr = [] users.each do |u| arr << { id: u.id, username: u.username, - role: u.roles.first } + role: u.roles.first, registrar_name: u.registrar.name } end arr diff --git a/app/controllers/repp/v1/domains/admin_contacts_controller.rb b/app/controllers/repp/v1/domains/admin_contacts_controller.rb index 6ec0e129b..5db865199 100644 --- a/app/controllers/repp/v1/domains/admin_contacts_controller.rb +++ b/app/controllers/repp/v1/domains/admin_contacts_controller.rb @@ -7,7 +7,7 @@ module Repp unless @new_contact.identical_to?(@current_contact) @epp_errors.add(:epp_errors, - msg: 'Admin contacts must be identical', + msg: 'New and current admin contacts ident data must be identical', code: '2304') end diff --git a/app/models/api_user.rb b/app/models/api_user.rb index d357a2e75..dc5cff0cc 100644 --- a/app/models/api_user.rb +++ b/app/models/api_user.rb @@ -74,6 +74,7 @@ class ApiUser < User self.class.where(identity_code: identity_code) .where("identity_code IS NOT NULL AND identity_code != ''") .where.not(id: id) + .includes(:registrar) end def linked_with?(another_api_user)