feat: make compute stats more robust by excluding pages with title "Famile de resistant"

wip-related-pages
Sébastien Arod 2024-09-02 14:53:30 +02:00
parent 645280f863
commit 5488d90b62
1 changed files with 4 additions and 2 deletions

View File

@ -34,12 +34,14 @@ export async function fetchFamiliesWithEventsFromNotion(
return buildFamilyEvent(pageObjectResponse); return buildFamilyEvent(pageObjectResponse);
}); });
const families: Famille[] = await Promise.all( const familles: Famille[] = await Promise.all(
familyPages.map((pageObjectResponse) => { familyPages.map((pageObjectResponse) => {
return buildFamily(pageObjectResponse, familyEvents); return buildFamily(pageObjectResponse, familyEvents);
}) })
); );
return families; // Fix to remove the empty "Famille de résistant" page that is often created by mistake
const filtered = familles.filter(f => f.Titre !== "Famille de résistant");
return filtered;
} }
function buildFamilyEvent(page: PageObjectResponse): EvenementFamille { function buildFamilyEvent(page: PageObjectResponse): EvenementFamille {