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(
`SELECT json FROM conversations WHERE
(
e164 LIKE $e164 OR
name LIKE $name OR
profileFullName LIKE $profileFullName
e164 LIKE $query OR
name LIKE $query OR
profileFullName LIKE $query
)
ORDER BY active_at DESC
LIMIT $limit`,
{
$e164: `%${query}%`,
$name: `%${query}%`,
$profileFullName: `%${query}%`,
$query: `%${query}%`,
$limit: limit || 100,
}
);