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);