Shorten searchConversations SQL query
This commit is contained in:
parent
eb203ba929
commit
6bbcf86772
1 changed files with 4 additions and 6 deletions
|
@ -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,
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue