diff --git a/app/controllers/admins_controller.rb b/app/controllers/admins_controller.rb index ee963ac3..f8412ccc 100644 --- a/app/controllers/admins_controller.rb +++ b/app/controllers/admins_controller.rb @@ -209,13 +209,12 @@ class AdminsController < ApplicationController initial_list = User.without_role(:super_admin) .where.not(uid: current_user.uid) .merge_list_search(params[:search]) - .pluck_to_hash(:uid, :name, :email) initial_list = initial_list.where(provider: @user_domain) if Rails.configuration.loadbalanced_configuration # Respond with JSON object of users respond_to do |format| - format.json { render body: initial_list.to_json } + format.json { render body: initial_list.pluck_to_hash(:uid, :name, :email).to_json } end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 23afc65a..008de477 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -212,13 +212,12 @@ class UsersController < ApplicationController initial_list = User.where.not(uid: params[:owner_uid]) .with_role(roles_can_appear) .shared_list_search(params[:search]) - .pluck_to_hash(:uid, :name) initial_list = initial_list.where(provider: @user_domain) if Rails.configuration.loadbalanced_configuration # Respond with JSON object of users respond_to do |format| - format.json { render body: initial_list.to_json } + format.json { render body: initial_list.pluck_to_hash(:uid, :name).to_json } end end