fix(crm): fix Lexware import duplicate detection — pageSize 500 exceeded backend max 100

The backend DTO validation enforces @Max(100) on pageSize. The ImportTab
was requesting pageSize=500, causing a 400 Bad Request. This left the
linkedMap empty and showed import buttons for already-imported contacts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas Reitz 2026-03-11 11:12:32 +01:00
parent 6e77bf43b0
commit 332a623d6f

View file

@ -75,8 +75,9 @@ function ImportTab() {
const createContact = useCreateContact();
// Load CRM entities to detect already-imported Lexware contacts
const companiesQuery = useCompanies({ page: 1, pageSize: 500, sort: 'name', order: 'asc' });
const contactsQuery = useContacts({ page: 1, pageSize: 500, sort: 'lastName', order: 'asc' });
// pageSize max 100 (backend DTO validation @Max(100))
const companiesQuery = useCompanies({ page: 1, pageSize: 100, sort: 'name', order: 'asc' });
const contactsQuery = useContacts({ page: 1, pageSize: 100, sort: 'lastName', order: 'asc' });
// Build lookup: lexwareContactId → { type, name, id }
const linkedMap = new Map<string, { type: 'company' | 'contact'; name: string; id: string }>();