From 619b63df59ca4852db8ffa1a6b91c0b74cf38576 Mon Sep 17 00:00:00 2001 From: Arnaud AMBROSELLI Date: Mon, 29 Jul 2024 17:25:57 +0200 Subject: [PATCH] fix: non renseigne --- api-node/src/aggregators/bathing_water.ts | 1 - api-node/src/utils/bathing_water/scrapping.ts | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/api-node/src/aggregators/bathing_water.ts b/api-node/src/aggregators/bathing_water.ts index 5ccf9a7e..1a929f8e 100644 --- a/api-node/src/aggregators/bathing_water.ts +++ b/api-node/src/aggregators/bathing_water.ts @@ -41,7 +41,6 @@ export async function getBathingWaterIndicator() { const municipalities = await prisma.municipality.findMany({ where: { bathing_water_sites: { gt: 0 }, - COM: String(76637), }, orderBy: { DEP: 'desc', diff --git a/api-node/src/utils/bathing_water/scrapping.ts b/api-node/src/utils/bathing_water/scrapping.ts index 9c41f8da..b37211a5 100644 --- a/api-node/src/utils/bathing_water/scrapping.ts +++ b/api-node/src/utils/bathing_water/scrapping.ts @@ -118,6 +118,9 @@ export async function scrapeHtmlBaignadesSitePage( return BathingWaterResultEnum.GOOD; default: // if there is no test result, the parsing fails and the value is 'communiqué' + if (lastTest.includes('Non renseign')) { + return BathingWaterResultEnum.NO_RESULT_FOUND; + } if (value !== 'communiqué' && !!value) { capture(`Unknown bathing water label ${value}`, { extra: { @@ -131,7 +134,7 @@ export async function scrapeHtmlBaignadesSitePage( }); } // TODO FIXME: we should return BathingWaterResultEnum.NO_RESULT_FOUND - return BathingWaterResultEnum.GOOD; + return BathingWaterResultEnum.NO_RESULT_FOUND; } }