From d8e527dbbb0228f6fa883360a82b8db8a3e8b7b0 Mon Sep 17 00:00:00 2001 From: Alex Plekhov <33345177+Lao-Ax@users.noreply.github.com> Date: Wed, 21 Feb 2024 15:49:24 +0300 Subject: [PATCH] Update emojis.ts Before the fix emoji could be found only by a subsctring from a string start. For example, we have two emojis 1) foo 2) bar_foo When you perform a search by keyword 'foo' only the first one will be found. Now, both will be found. --- app/lib/methods/emojis.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/methods/emojis.ts b/app/lib/methods/emojis.ts index 6564470c4..15c742368 100644 --- a/app/lib/methods/emojis.ts +++ b/app/lib/methods/emojis.ts @@ -51,7 +51,7 @@ export const searchEmojis = async (keyword: string): Promise => { const likeString = sanitizeLikeString(keyword); const whereClause = []; if (likeString) { - whereClause.push(Q.where('name', Q.like(`${likeString}%`))); + whereClause.push(Q.where('name', Q.like(`%${likeString}%`))); } const db = database.active; const customEmojisCollection = await db