From 162a8c0bdd311079af39bdeddde7fa0cddece0a6 Mon Sep 17 00:00:00 2001 From: antoineludeau <52679050+antoineludeau@users.noreply.github.com> Date: Wed, 31 Jul 2024 16:00:10 +0200 Subject: [PATCH] Fixed ban id generation on lieu-dit assemblage --- lib/compose/strategies/multi-sources/lieux-dits.cjs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/compose/strategies/multi-sources/lieux-dits.cjs b/lib/compose/strategies/multi-sources/lieux-dits.cjs index 1488f848..bfcc0a9a 100644 --- a/lib/compose/strategies/multi-sources/lieux-dits.cjs +++ b/lib/compose/strategies/multi-sources/lieux-dits.cjs @@ -7,11 +7,13 @@ async function buildLieuxDits(sourcesData, {existingVoiesIds}) { if (cadastreData) { const lieuxDitsData = cadastreData.lieuxDits.filter(ld => !existingVoiesIds.has(ld.idVoie)) - const banId = IS_GENERATE_BANID_ON_ASSEMBLY ? uuidv4() : undefined - return lieuxDitsData.map(ld => ({ - banId, - ...ld - })) + return lieuxDitsData.map(ld => { + const banId = IS_GENERATE_BANID_ON_ASSEMBLY ? uuidv4() : undefined + return { + banId, + ...ld + } + }) } return []