Skip to content

Commit

Permalink
Merge pull request benawad#2793 from amitojsingh366/patch-63
Browse files Browse the repository at this point in the history
fix(kousa): search
  • Loading branch information
benawad authored May 16, 2021
2 parents 603419f + 67381e8 commit 743790e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kousa/lib/beef/access/users.ex
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,10 @@ defmodule Beef.Access.Users do

def search_user(username_or_display_name) do
search_str = username_or_display_name <> "%"
search_str = String.replace(search_str, ~r/([_])/, ~s(\\\_))

Query.start()
# here
|> where([u], ilike(u.username, ^search_str) or ilike(u.displayName, ^search_str))
|> where([u], ilike(u.username, ^search_str))
|> order_by([u], desc: u.numFollowers)
|> limit([], 15)
|> Repo.all()
Expand Down

0 comments on commit 743790e

Please sign in to comment.