From 831134e0d586f14aef5dc987a3453215ad793314 Mon Sep 17 00:00:00 2001
From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com>
Date: Tue, 9 Aug 2022 14:44:09 +0200
Subject: [PATCH] publish: remove file

generated from commit d9f03727a4d78d9b8c440832ef81cd690461d587
---
 index.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/index.js b/index.js
index 6f2f7fa..2e0549c 100644
--- a/index.js
+++ b/index.js
@@ -73,6 +73,7 @@ async function start(fields, cozyParameters) {
   const pointId = fields.pointId
   let baseUrl = fields.wso2BaseUrl
   let apiAuthKey = fields.apiToken
+  let contractId = fields.contractId
   //TODO switch variable to english
   let sgeLogin = fields.sgeLogin
   log('info', 'Authenticating ...')
@@ -81,6 +82,7 @@ async function start(fields, cozyParameters) {
     log('debug', 'Found COZY_PARAMETERS')
     baseUrl = cozyParameters.secret.wso2BaseUrl
     apiAuthKey = cozyParameters.secret.apiToken
+    contractId = cozyParameters.secret.contractId
     sgeLogin = cozyParameters.secret.sgeLogin
   }
 
@@ -116,7 +118,7 @@ async function start(fields, cozyParameters) {
       baseUrl,
       apiAuthKey,
       sgeLogin,
-      fields.contractId,
+      contractId,
       user.pointId
     )
     if (!serviceId) {
@@ -124,7 +126,7 @@ async function start(fields, cozyParameters) {
         baseUrl,
         apiAuthKey,
         sgeLogin,
-        fields.contractId,
+        contractId,
         user.lastname,
         user.pointId,
         contractStartDate,
@@ -157,7 +159,7 @@ async function start(fields, cozyParameters) {
           baseUrl,
           apiAuthKey,
           sgeLogin,
-          fields.contractId,
+          contractId,
           fields.pointId,
           userConsent.serviceId
         )
-- 
GitLab