From 8abc53adbebd01868a88151ca0bc186015f72902 Mon Sep 17 00:00:00 2001 From: Simon C Date: Wed, 11 Jan 2023 11:22:05 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20Un=20probl=C3=A8me=20d'import=20des=20co?= =?UTF-8?q?ntacts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/directus-to-markdown/index.js | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/scripts/directus-to-markdown/index.js b/scripts/directus-to-markdown/index.js index 2a67765..c9aafaa 100644 --- a/scripts/directus-to-markdown/index.js +++ b/scripts/directus-to-markdown/index.js @@ -41,18 +41,22 @@ const config = { const bureau = [] for (const contact of association.bureau) { const detail = contact.Contact_id - let c = { - denomination: detail.denomination, - prenom: detail.prenom, - nom: detail.nom, + if (detail) { + let c = { + denomination: detail.denomination, + prenom: detail.prenom, + nom: detail.nom, + } + if (detail.mail && detail.display_mail) { + c.mail = detail.mail + } + if (detail.telephone && detail.display_telephone) { + c.telephone = detail.telephone + } + bureau.push(c) + } else { + console.log("problème sur un contact") } - if (detail.mail && detail.display_mail) { - c.mail = detail.mail - } - if (detail.telephone && detail.display_telephone) { - c.telephone = detail.telephone - } - bureau.push(c) } association.bureau = bureau } else {