diff --git a/api-node/src/aggregators/bathing_water.ts b/api-node/src/aggregators/bathing_water.ts index 48ed820d..a4f0b5f1 100644 --- a/api-node/src/aggregators/bathing_water.ts +++ b/api-node/src/aggregators/bathing_water.ts @@ -135,7 +135,7 @@ export async function getBathingWaterIndicator() { } const diffusionDate = scrapingResult.result_date ? scrapingResult.result_date - : dayjs().format('YYYY-MM-DD'); + : dayjs().utc().startOf('year'); const existingResults = await prisma.bathingWater.count({ where: { diffusion_date: dayjs(diffusionDate).utc().toDate(), @@ -164,6 +164,7 @@ export async function getBathingWaterIndicator() { id_carte: idCarte, isite: site.isite, name: site.nom, + result_date: scrapingResult.result_date, result_value: scrapingResult.result_value, swimming_season_start: scrapingResult.swimming_season_start, swimming_season_end: scrapingResult.swimming_season_end,