From 16f193c41fe7aa47378fd4cc0d1a967553b5842d Mon Sep 17 00:00:00 2001
From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com>
Date: Thu, 11 Aug 2022 10:17:50 +0200
Subject: [PATCH] publish: fix: build

generated from commit e1b85de07c58540ec31d27517693c4d11397d6d0
---
 index.js           | 7 ++++++-
 onDeleteAccount.js | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/index.js b/index.js
index 0582c0e..2f82e06 100644
--- a/index.js
+++ b/index.js
@@ -223932,8 +223932,13 @@ async function updateBoConsent(url, token, consent, serviceId) {
 
   try {
     log('info', consent.ID)
+    let consentId = ''
+    if (consent.ID) {
+      consentId = consent.ID.toString()
+    }
+    log('info', consentId)
     const { data } = await axios.put(
-      `${url}/consent/${consent.ID?.toString()}`,
+      `${url}/consent/${consentId}`,
       {
         ...consent,
         serviceId: parseInt(serviceId),
diff --git a/onDeleteAccount.js b/onDeleteAccount.js
index 7422b31..5e26736 100644
--- a/onDeleteAccount.js
+++ b/onDeleteAccount.js
@@ -223324,8 +223324,13 @@ async function updateBoConsent(url, token, consent, serviceId) {
 
   try {
     log('info', consent.ID)
+    let consentId = ''
+    if (consent.ID) {
+      consentId = consent.ID.toString()
+    }
+    log('info', consentId)
     const { data } = await axios.put(
-      `${url}/consent/${consent.ID?.toString()}`,
+      `${url}/consent/${consentId}`,
       {
         ...consent,
         serviceId: parseInt(serviceId),
-- 
GitLab