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 <gleidson10daniel@hotmail.com>
This commit is contained in:
parent
55f3de5449
commit
f56f19abc6
|
@ -51,7 +51,7 @@ export const searchEmojis = async (keyword: string): Promise<IEmoji[]> => {
|
||||||
const likeString = sanitizeLikeString(keyword);
|
const likeString = sanitizeLikeString(keyword);
|
||||||
const whereClause = [];
|
const whereClause = [];
|
||||||
if (likeString) {
|
if (likeString) {
|
||||||
whereClause.push(Q.where('name', Q.like(`${likeString}%`)));
|
whereClause.push(Q.where('name', Q.like(`%${likeString}%`)));
|
||||||
}
|
}
|
||||||
const db = database.active;
|
const db = database.active;
|
||||||
const customEmojisCollection = await db
|
const customEmojisCollection = await db
|
||||||
|
|
Loading…
Reference in New Issue