Shorten searchConversations SQL query

This commit is contained in:
Evan Hahn 2021-02-12 18:40:39 -06:00 committed by Josh Perez
parent eb203ba929
commit 6bbcf86772

View file

@ -2391,16 +2391,14 @@ async function searchConversations(
const rows = await db.all( const rows = await db.all(
`SELECT json FROM conversations WHERE `SELECT json FROM conversations WHERE
( (
e164 LIKE $e164 OR e164 LIKE $query OR
name LIKE $name OR name LIKE $query OR
profileFullName LIKE $profileFullName profileFullName LIKE $query
) )
ORDER BY active_at DESC ORDER BY active_at DESC
LIMIT $limit`, LIMIT $limit`,
{ {
$e164: `%${query}%`, $query: `%${query}%`,
$name: `%${query}%`,
$profileFullName: `%${query}%`,
$limit: limit || 100, $limit: limit || 100,
} }
); );