From f5457b6fec2e52835b13d2f1e239b4023ab4486d Mon Sep 17 00:00:00 2001 From: ponchimeow Date: Mon, 11 Dec 2023 12:13:18 +0800 Subject: [PATCH] fix: phone filter --- src/components/sale/SalesLeadTable.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/sale/SalesLeadTable.tsx b/src/components/sale/SalesLeadTable.tsx index c1ddf113a..5e7c0a781 100644 --- a/src/components/sale/SalesLeadTable.tsx +++ b/src/components/sale/SalesLeadTable.tsx @@ -209,7 +209,12 @@ const SalesLeadTable: React.VFC<{ const nameAndEmailMatch = matchesFilter(nameAndEmail)(name + email + fullName) - const phoneMatch = matchesFilter(phone)(phones.join('')) + const phoneMatch = matchesFilter(phone)( + phones + .filter(phone => phone.isValid) + .map(phone => phone.phoneNumber) + .join(''), + ) const categoryNameMatch = matchesFilter(categoryName)(categoryNames.join(''))