fix: Maps-Vault-Sync sofort nach Google Maps, nicht erst nach Anymailfinder
- Google Maps Ergebnisse werden direkt nach der Suche in LeadVault gespeichert - Anymailfinder-Fehler führen nicht mehr zum Datenverlust - Bessere Fehlermeldungen: echter Fehlertext statt hardcoded Message - Anymailfinder-Fehlermeldung auf Deutsch Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -121,14 +121,14 @@ export default function MapsPage() {
|
||||
try {
|
||||
const res = await fetch(`/api/jobs/${id}/status`);
|
||||
const data = await res.json() as {
|
||||
status: string; totalLeads: number; emailsFound: number; results: ResultRow[];
|
||||
status: string; totalLeads: number; emailsFound: number; results: ResultRow[]; error?: string;
|
||||
};
|
||||
|
||||
if (data.totalLeads > 0 && data.emailsFound === 0 && enrichEmails) {
|
||||
phase = "Enriching with Anymailfinder...";
|
||||
phase = "Anreicherung mit Anymailfinder...";
|
||||
}
|
||||
if (data.emailsFound > 0) {
|
||||
phase = `Found ${data.emailsFound} emails so far...`;
|
||||
phase = `${data.emailsFound} E-Mails gefunden...`;
|
||||
}
|
||||
|
||||
setProgress({
|
||||
@@ -146,12 +146,13 @@ export default function MapsPage() {
|
||||
if (data.status === "complete") {
|
||||
setStage("done");
|
||||
const msg = enrichEmails
|
||||
? `Done! ${data.totalLeads} companies found, ${data.emailsFound} emails enriched`
|
||||
: `Done! ${data.totalLeads} companies found`;
|
||||
? `Fertig! ${data.totalLeads} Unternehmen gefunden, ${data.emailsFound} E-Mails angereichert`
|
||||
: `Fertig! ${data.totalLeads} Unternehmen gefunden`;
|
||||
toast.success(msg);
|
||||
} else {
|
||||
setStage("failed");
|
||||
toast.error("Job failed. Check your Google Maps API key in Settings.");
|
||||
const errMsg = data.error || "Unbekannter Fehler";
|
||||
toast.error(`Job fehlgeschlagen: ${errMsg}`);
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user