Skip to content

Commit b44b75b

Browse files
authored
fix: Default if NAF code description not available (#2162)
1 parent cf292a9 commit b44b75b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/app/src/api/core-domain/infra/pdf/templates/DeclarationReceipt.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const DeclarationReceipt = (input: DeclarationOpmc) => {
7272
},
7373
{
7474
key: "Code NAF",
75-
value: `${nafCode} - ${NAF[nafCode].description}`,
75+
value: `${nafCode} - ${NAF[nafCode] ? NAF[nafCode].description : ""}`,
7676
},
7777
{
7878
key: "Adresse",

packages/app/src/api/core-domain/infra/pdf/templates/RepresentationEquilibreeReceipt.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const RepresentationEquilibreeReceipt = ({ repEq }: RepresentationEquilib
4848
},
4949
{
5050
key: "Code NAF",
51-
value: `${nafCode} - ${NAF[nafCode].description}`,
51+
value: `${nafCode} - ${NAF[nafCode] ? NAF[nafCode].description : ""}`,
5252
},
5353
{
5454
key: "Adresse",

packages/app/src/design-system/base/RecapCardCompany.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const RecapCardCompany = ({ company, full, title, edit }: Props) => {
4444
<GridCol sm={9} className="fr-pb-0">
4545
<strong>Code NAF</strong>
4646
<br />
47-
{nafCode} - {NAF[nafCode].description}
47+
{nafCode} - {NAF[nafCode] ? NAF[nafCode].description : ""}
4848
</GridCol>
4949
)}
5050
<GridCol sm={12}>
@@ -68,7 +68,7 @@ export const RecapCardCompany = ({ company, full, title, edit }: Props) => {
6868
<br />
6969
Siren : <strong>{siren}</strong>
7070
<br />
71-
Code NAF : <strong>{nafCode}</strong> - {nafCode && NAF[nafCode].description}
71+
Code NAF : <strong>{nafCode}</strong> - {nafCode && NAF[nafCode] ? NAF[nafCode].description : ""}
7272
<br />
7373
{workforce?.range && (
7474
<>

0 commit comments

Comments
 (0)