Skip to content

Commit f56f19a

Browse files
Lao-Axdnlsilva
andauthored
feat: add search emoji by substring (#5585)
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. Co-authored-by: Gleidson Daniel Silva <[email protected]>
1 parent 55f3de5 commit f56f19a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/lib/methods/emojis.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const searchEmojis = async (keyword: string): Promise<IEmoji[]> => {
5151
const likeString = sanitizeLikeString(keyword);
5252
const whereClause = [];
5353
if (likeString) {
54-
whereClause.push(Q.where('name', Q.like(`${likeString}%`)));
54+
whereClause.push(Q.where('name', Q.like(`%${likeString}%`)));
5555
}
5656
const db = database.active;
5757
const customEmojisCollection = await db

0 commit comments

Comments
 (0)