fix: Leads ohne Domain werden gefiltert und nicht gespeichert

Maps-Ergebnisse ohne Domain werden vor Speicherung herausgefiltert.
sinkLeadsToVault überspringt Leads ohne Domain komplett.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
TimoUttenweiler
2026-04-01 10:54:30 +02:00
parent 929d5ab3a1
commit 25234b70ee
2 changed files with 13 additions and 7 deletions

View File

@@ -98,6 +98,8 @@ export async function sinkLeadsToVault(
const domain = lead.domain || null;
const email = lead.email || null;
if (!domain) { skipped++; continue; } // no domain → skip entirely
if (domain) {
// Strict domain dedup: one lead per domain
const existing = await prisma.lead.findFirst({ where: { domain } });