From 27c80bd7b5a251c1eb231c6140ef74c1f8a8cfe6 Mon Sep 17 00:00:00 2001 From: Jonathan Perrault Date: Fri, 22 Mar 2024 14:22:49 +0100 Subject: [PATCH] fix: enterprise missing info check --- .../index-egapro/declaration/commencer/CommencerForm.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/app/src/app/(default)/index-egapro/declaration/commencer/CommencerForm.tsx b/packages/app/src/app/(default)/index-egapro/declaration/commencer/CommencerForm.tsx index 1df190788..1846fada0 100644 --- a/packages/app/src/app/(default)/index-egapro/declaration/commencer/CommencerForm.tsx +++ b/packages/app/src/app/(default)/index-egapro/declaration/commencer/CommencerForm.tsx @@ -106,11 +106,11 @@ export const prepareDataWithExistingDeclaration = async ( entreprise: { ...baseFormData.entreprise, entrepriseDéclarante: { - adresse: company?.firstMatchingEtablissement.address.includes("[ND]") + adresse: company.firstMatchingEtablissement.address?.includes("[ND]") ? "Information non diffusible" : company?.firstMatchingEtablissement.address, codeNaf: company.activitePrincipaleUniteLegale, - codePostal: company.firstMatchingEtablissement?.codePostalEtablissement.includes("[ND]") + codePostal: company.firstMatchingEtablissement?.codePostalEtablissement?.includes("[ND]") ? undefined : company.firstMatchingEtablissement?.codePostalEtablissement, codePays: company.firstMatchingEtablissement?.codePaysEtrangerEtablissement @@ -118,7 +118,7 @@ export const prepareDataWithExistingDeclaration = async ( : undefined, raisonSociale: company.simpleLabel, siren, - commune: company.firstMatchingEtablissement?.libelleCommuneEtablissement.includes("[ND]") + commune: company.firstMatchingEtablissement?.libelleCommuneEtablissement?.includes("[ND]") ? undefined : company.firstMatchingEtablissement?.libelleCommuneEtablissement, département: countyCode,