From 11697113dd42a54d7b3bb2cc68d5d43f20074784 Mon Sep 17 00:00:00 2001 From: Marc Rutkowski Date: Mon, 30 Oct 2023 16:45:38 +0100 Subject: [PATCH] =?UTF-8?q?R=C3=A9tabli=20la=20possibilit=C3=A9=20de=20cr?= =?UTF-8?q?=C3=A9er=20un=20nouveau=20plan=20d'action=20(quand=20aucun=20pl?= =?UTF-8?q?an=20n'existe=20d=C3=A9j=C3=A0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/collectivite/PlansActions/PlanAction/data/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.territoiresentransitions.react/src/app/pages/collectivite/PlansActions/PlanAction/data/utils.ts b/app.territoiresentransitions.react/src/app/pages/collectivite/PlansActions/PlanAction/data/utils.ts index be96fa0ce3..3010b68cbf 100644 --- a/app.territoiresentransitions.react/src/app/pages/collectivite/PlansActions/PlanAction/data/utils.ts +++ b/app.territoiresentransitions.react/src/app/pages/collectivite/PlansActions/PlanAction/data/utils.ts @@ -85,7 +85,7 @@ export const planNodeFactory = ({ parentDepth, nom, }: PlanNodeFactory): PlanNode => { - const lowerId = axes.reduce((a, b) => (a.id! < b.id! ? a : b)).id; + const lowerId = axes?.reduce((a, b) => (a.id! < b.id! ? a : b), {id: 0}).id; const tempId = Math.min(0, lowerId || 0) - 1; return {