From 9e05b1a0e1bf3c49ad070d46647301f4dd664465 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 14 Jun 2017 03:42:16 +0900 Subject: [PATCH] [API] Improve inteligence --- src/api/endpoints/users/search.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/endpoints/users/search.ts b/src/api/endpoints/users/search.ts index a3f2fb796..73a5db47e 100644 --- a/src/api/endpoints/users/search.ts +++ b/src/api/endpoints/users/search.ts @@ -42,7 +42,7 @@ async function byNative(res, rej, me, query, offset, max) { const users = await User .find({ $or: [{ - username_lower: new RegExp(escapedQuery.toLowerCase()) + username_lower: new RegExp(escapedQuery.replace('@', '').toLowerCase()) }, { name: new RegExp(escapedQuery) }]