Originally created by: sumamakhan761
Counters skew on "Load More":
In AudienceListDashboard.tsx, the top metric cards (Captured Contacts, Verified Emails, Phone Numbers) and the "All Contacts" master card compute their values using contacts.length and contacts.reduce(...).
Because contacts are paginated (limit=15), the counters initially display only 15, and arbitrarily increment every time a user clicks "Load More".
CSV Export is capped to client DOM:
ExportConfigModal only exports the contacts stored in the browser's React state. If a tenant has 150 leads, exporting produces a CSV with only the 15 currently loaded contacts unless they repeatedly click "Load More" first.
totalContacts, totalEmails, totalPhones) regardless of pagination state or how many rows are rendered on screen.crm-export.service.ts & email-list-query.dto.ts):export?: string field to EmailListQueryDto.In crm-export.service.ts:
query.export === 'true', raise limit cap to e.g. 10,000 and set offset = 0.getEmailList, compute global email/phone stats across all matching contacts and return:ts
stats: {
totalContacts: total,
totalEmails,
totalPhones,
}Frontend Dashboard (AudienceListDashboard.tsx):
stats returned by /api/audience-contacts in component state.stats instead of contacts.length or contacts.reduce(...).Pass an onFetchAllForExport callback to <ExportConfigModal /> that queries /api/audience-contacts?export=true with active filters.
Export Modal (ExportConfigModal.tsx):
totalCount?: number and onFetchAllForExport?: () => Promise<Contact[]>.onFetchAllForExport() to compile and download all rows matching the tenant scope.