From 3c23842924fb031810bde9421130c13dc9ce6ada Mon Sep 17 00:00:00 2001 From: xavier jouppe Date: Fri, 8 Nov 2024 08:49:39 +0100 Subject: [PATCH 1/2] fix: activite object can be null --- src/clients/ig/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/clients/ig/index.ts b/src/clients/ig/index.ts index 820fa04..717dfde 100644 --- a/src/clients/ig/index.ts +++ b/src/clients/ig/index.ts @@ -152,8 +152,8 @@ const mapToDomainObject = (r: IGResponse, siren: Siren) => { nomComplet, etat: r.etat === 'ACTIF' ? 'A' : 'C', libelleNatureJuridique, - activitePrincipale: r.activite_naf.code, - libelleActivitePrincipale: r.activite_naf.libelle, + activitePrincipale: r.activite_naf?.code || '', + libelleActivitePrincipale: r.activite_naf?.libelle || '', dateCreation: '', siege: null, association: { From c0273bf9ae173cfec2d3dc97bea4aa3065380c89 Mon Sep 17 00:00:00 2001 From: xavier jouppe Date: Fri, 8 Nov 2024 08:55:37 +0100 Subject: [PATCH 2/2] fix: eslint --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2aa513a..29cc2ea 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "dev": "nodemon index.ts", "start": "node dist/index.js", "test": "jest --runInBand", - "lint": "eslint src/**/*", + "lint": "npx eslint src/**/*", "build": "tsc" }, "dependencies": {