diff --git a/app/api/jobs/maps-enrich/route.ts b/app/api/jobs/maps-enrich/route.ts index 3cd5c57..49d4877 100644 --- a/app/api/jobs/maps-enrich/route.ts +++ b/app/api/jobs/maps-enrich/route.ts @@ -152,16 +152,21 @@ async function runMapsEnrich( // Sync to LeadVault const finalResults = await prisma.leadResult.findMany({ where: { jobId } }); await sinkLeadsToVault( - finalResults.map(r => ({ - domain: r.domain, - companyName: r.companyName, - contactName: r.contactName, - contactTitle: r.contactTitle, - email: r.email, - linkedinUrl: r.linkedinUrl, - emailConfidence: r.confidence, - phone: (() => { try { return JSON.parse(r.source || "{}").phone ?? null; } catch { return null; } })(), - })), + finalResults.map(r => { + let src: { phone?: string; address?: string } = {}; + try { src = JSON.parse(r.source || "{}"); } catch { /* ignore */ } + return { + domain: r.domain, + companyName: r.companyName, + contactName: r.contactName, + contactTitle: r.contactTitle, + email: r.email, + linkedinUrl: r.linkedinUrl, + emailConfidence: r.confidence, + phone: src.phone || null, + address: src.address || null, + }; + }), "maps", params.queries.join(", "), jobId, diff --git a/app/leadvault/page.tsx b/app/leadvault/page.tsx index bf22a06..87e9386 100644 --- a/app/leadvault/page.tsx +++ b/app/leadvault/page.tsx @@ -23,6 +23,7 @@ interface Lead { email: string | null; linkedinUrl: string | null; phone: string | null; + address: string | null; sourceTab: string; sourceTerm: string | null; sourceJobId: string | null; @@ -264,7 +265,13 @@ function SidePanel({ lead, onClose, onUpdate }: { {fullLead.phone && (
+ )} + {fullLead.address && ( +{lead.contactName || "–"}
{lead.contactTitle &&{lead.contactTitle}
} +{lead.address}
+ ) : ( + – + )} + {lead.phone && lead.address && ( +{lead.address}
+ )} +