From da5939d1d6fc74239e35bacb88894b040cc6fbb9 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Thu, 12 Oct 2023 21:46:34 +0200 Subject: [PATCH] [mastodon-client] Proper user search autocomplete --- packages/backend/src/server/api/mastodon/helpers/search.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/mastodon/helpers/search.ts b/packages/backend/src/server/api/mastodon/helpers/search.ts index 576810087..9924c434c 100644 --- a/packages/backend/src/server/api/mastodon/helpers/search.ts +++ b/packages/backend/src/server/api/mastodon/helpers/search.ts @@ -106,7 +106,7 @@ export class SearchHelpers { query.andWhere( new Brackets((qb) => { qb.where("user.name ILIKE :q", { q: `%${sqlLikeEscape(q)}%` }); - qb.orWhere("user.usernameLower ILIKE :q", { q: `%${sqlLikeEscape(q)}%` }); + qb.orWhere("concat_ws('@', user.usernameLower, user.host) ILIKE :q", { q: `%${sqlLikeEscape(q)}%` }); }) );