Skip to content

Commit aac482e

Browse files
committed
Fix the searching on admin names and don't search on auth tokens.
The "first_name" and "last_name" columns don't exist on the admin collection, so this was actually just supposed to search on the "name" column. And I'm not sure why we really exposed searching on auth tokens, but this doesn't seem necessary.
1 parent 6fac759 commit aac482e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/api-umbrella/web-app/app/controllers/api/v1/admins_controller.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ def index
1717

1818
if(params["search"] && params["search"]["value"].present?)
1919
@admins = @admins.or([
20-
{ :first_name => /#{Regexp.escape(params["search"]["value"])}/i },
21-
{ :last_name => /#{Regexp.escape(params["search"]["value"])}/i },
20+
{ :name => /#{Regexp.escape(params["search"]["value"])}/i },
2221
{ :email => /#{Regexp.escape(params["search"]["value"])}/i },
2322
{ :username => /#{Regexp.escape(params["search"]["value"])}/i },
24-
{ :authentication_token => /#{Regexp.escape(params["search"]["value"])}/i },
2523
{ :_id => params[:search][:value].downcase },
2624
])
2725
end

0 commit comments

Comments
 (0)