user: search: use get_or_fetch() instead of get_or_fetch_by_nickname()

get_or_fetch() handles the nickname verses URI differences transparently.
This commit is contained in:
William Pitcock 2019-02-14 19:58:24 +00:00
parent 56862f4ce1
commit da44cdd381

View file

@ -731,7 +731,7 @@ def search(query, resolve \\ false, for_user \\ nil) do
# Strip the beginning @ off if there is a query # Strip the beginning @ off if there is a query
query = String.trim_leading(query, "@") query = String.trim_leading(query, "@")
if resolve, do: User.get_or_fetch_by_nickname(query) if resolve, do: get_or_fetch(query)
fts_results = do_search(fts_search_subquery(query), for_user) fts_results = do_search(fts_search_subquery(query), for_user)