diff --git a/app/controllers/directory_items_controller.rb b/app/controllers/directory_items_controller.rb index 8499f1a4b9a..70a729147c5 100644 --- a/app/controllers/directory_items_controller.rb +++ b/app/controllers/directory_items_controller.rb @@ -35,6 +35,15 @@ class DirectoryItemsController < ApplicationController end end + if params[:username] + user_id = User.where(username_lower: params[:username].to_s.downcase).pluck(:id).first + if user_id + result = result.where(user_id: user_id) + else + result = result.where('false') + end + end + result = result.order('users.username') result_count = result.dup.count result = result.limit(PAGE_SIZE).offset(PAGE_SIZE * page).to_a