From 412d26b0ff6530c531d6735a55ce6e47795b997f Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2026 23:49:00 +0000 Subject: [PATCH] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/components/cases/collections-tab.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/cases/collections-tab.tsx b/src/components/cases/collections-tab.tsx index 6a700a8..7269c42 100644 --- a/src/components/cases/collections-tab.tsx +++ b/src/components/cases/collections-tab.tsx @@ -171,12 +171,13 @@ export function CaseCollectionsTab({ const list = cols ?? []; setCollections(list); setHomeowners(hos ?? []); - // Filter: case_contacts.role = 'homeowner' OR contact.contact_type = 'homeowner' + // Only case-linked contacts whose role OR contact_type is 'homeowner' or 'tenant' + const ALLOWED = new Set(["homeowner", "tenant"]); const hoContacts = (ccs ?? []) .filter((cc: any) => { - const roleMatch = (cc.role || "").toLowerCase() === "homeowner"; - const typeMatch = (cc.contact?.contact_type || "").toLowerCase() === "homeowner"; - return cc.contact && (roleMatch || typeMatch); + const role = (cc.role || "").toLowerCase(); + const type = (cc.contact?.contact_type || "").toLowerCase(); + return cc.contact && (ALLOWED.has(role) || ALLOWED.has(type)); }) .map((cc: any) => ({ ...cc.contact, _link_role: cc.role })); setContactHomeowners(hoContacts);