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.phone} + {fullLead.phone} +
+ )} + {fullLead.address && ( +
+ 📍 + {fullLead.address}
)} {fullLead.linkedinUrl && ( @@ -794,6 +801,7 @@ export default function LeadVaultPage() { ["priority", "Priorität"], ["companyName", "Unternehmen"], ["contactName", "Kontakt"], + ["phone", "Telefon"], ["email", "E-Mail"], ["sourceTab", "Quelle"], ["capturedAt", "Erfasst"], @@ -868,6 +876,21 @@ export default function LeadVaultPage() {

{lead.contactName || "–"}

{lead.contactTitle &&

{lead.contactTitle}

} + + {lead.phone ? ( + e.stopPropagation()} + className="text-xs text-gray-300 hover:text-white whitespace-nowrap"> + {lead.phone} + + ) : lead.address ? ( +

{lead.address}

+ ) : ( + + )} + {lead.phone && lead.address && ( +

{lead.address}

+ )} + e.stopPropagation()}> {lead.email ? (