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[]> {
|
): Promise<FdiskUntersuchung[]> {
|
||||||
const url = `${BASE_URL}/fdisk/module/mgvw/untersuchungen/UntersuchungenList.aspx`
|
const url = `${BASE_URL}/fdisk/module/mgvw/untersuchungen/UntersuchungenList.aspx`
|
||||||
+ `?search=1&searchid_mitgliedschaften=${idMitgliedschaft}&id_personen=${idPersonen}`
|
+ `?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);
|
await frame_goto(frame, url);
|
||||||
|
|
||||||
@@ -978,22 +979,9 @@ async function scrapeMemberUntersuchungen(
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
// The initial page load may only show a default number of rows.
|
// Belt-and-suspenders: if the URL param didn't stick, use Playwright's selectOption
|
||||||
// Set the dropdown to ALLE and submit the form (which includes ViewState)
|
// which properly triggers the ASP.NET change event + postback.
|
||||||
// so ASP.NET returns all records.
|
await selectAlleAnzeige(frame);
|
||||||
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(() => {});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Parse the table using navigateAndGetTableRows logic (reuse existing page state)
|
// Parse the table using navigateAndGetTableRows logic (reuse existing page state)
|
||||||
// Re-collect rows from the already-loaded page
|
// Re-collect rows from the already-loaded page
|
||||||
|
|||||||
Reference in New Issue
Block a user