fix(sync): calculate G26 gueltig_bis (default 5y, override via Anmerkungen) and load all Untersuchungen via URL param
This commit is contained in:
@@ -967,7 +967,8 @@ async function scrapeMemberUntersuchungen(
|
||||
): Promise<FdiskUntersuchung[]> {
|
||||
const url = `${BASE_URL}/fdisk/module/mgvw/untersuchungen/UntersuchungenList.aspx`
|
||||
+ `?search=1&searchid_mitgliedschaften=${idMitgliedschaft}&id_personen=${idPersonen}`
|
||||
+ `&id_mitgliedschaften=${idMitgliedschaft}&searchid_personen=${idPersonen}&searchid_maskmode=`;
|
||||
+ `&id_mitgliedschaften=${idMitgliedschaft}&searchid_personen=${idPersonen}&searchid_maskmode=`
|
||||
+ `&anzeige_count=ALLE`;
|
||||
|
||||
await frame_goto(frame, url);
|
||||
|
||||
@@ -978,22 +979,9 @@ async function scrapeMemberUntersuchungen(
|
||||
return [];
|
||||
}
|
||||
|
||||
// The initial page load may only show a default number of rows.
|
||||
// Set the dropdown to ALLE and submit the form (which includes ViewState)
|
||||
// so ASP.NET returns all records.
|
||||
const needsReload = await frame.evaluate(() => {
|
||||
const sel = document.querySelector('select[name="anzeige_count"]') as HTMLSelectElement | null;
|
||||
if (!sel) return false;
|
||||
if (sel.value === 'ALLE') return false;
|
||||
sel.value = 'ALLE';
|
||||
const form = sel.closest('form') as HTMLFormElement | null;
|
||||
if (form) { form.submit(); return true; }
|
||||
return false;
|
||||
}).catch(() => false);
|
||||
|
||||
if (needsReload) {
|
||||
await frame.waitForNavigation({ waitUntil: 'networkidle', timeout: 15000 }).catch(() => {});
|
||||
}
|
||||
// Belt-and-suspenders: if the URL param didn't stick, use Playwright's selectOption
|
||||
// which properly triggers the ASP.NET change event + postback.
|
||||
await selectAlleAnzeige(frame);
|
||||
|
||||
// Parse the table using navigateAndGetTableRows logic (reuse existing page state)
|
||||
// Re-collect rows from the already-loaded page
|
||||
|
||||
Reference in New Issue
Block a user