fix: Use search API instead of filter in the filter in the endpoints (#13651)

- Replace `POST /contacts/filter` with `GET /contacts/search` for
contact lookup in compose new conversation
- Remove client-side input-type detection logic (`generateContactQuery`,
key filtering by email/phone/name) — the search API handles matching
across name, email, phone_number, and identifier server-side via a
single `ILIKE` query
- Filter the contacts with emails in cc and bcc fields.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: iamsivin <iamsivin@gmail.com>
This commit is contained in:
Pranav
2026-04-14 16:36:06 +05:30
committed by aakashb95
co-authored by Claude Opus 4.6 iamsivin
parent b232a8f7a3
commit cb4dba9a20
5 changed files with 27 additions and 148 deletions
@@ -119,10 +119,7 @@ const debouncedSearch = debounce(async query => {
}
try {
const contacts = await searchContacts({
keys: ['name', 'email', 'phone_number'],
query,
});
const contacts = await searchContacts(query);
// Add selected contact to top if not already in results
const allContacts = selectedContact.value