From 312f9368d980d1c4fb900e94e604628e9b625805 Mon Sep 17 00:00:00 2001
From: hnouts <hnouts@grandlyon.com>
Date: Mon, 31 Jan 2022 17:12:01 +0100
Subject: [PATCH] logs

Detailed description.
---
 src/components/Connection/ConnectionOAuth.tsx    | 2 ++
 src/components/Konnector/KonnectorViewerCard.tsx | 5 +++++
 src/services/account.service.ts                  | 7 +------
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/components/Connection/ConnectionOAuth.tsx b/src/components/Connection/ConnectionOAuth.tsx
index 1bd69c164..3fbccefa1 100644
--- a/src/components/Connection/ConnectionOAuth.tsx
+++ b/src/components/Connection/ConnectionOAuth.tsx
@@ -43,6 +43,7 @@ const ConnectionOAuth: React.FC<ConnectionOAuthProps> = ({
         const accountService = new AccountService(client)
         const account = await accountService.getAccount(accountId)
         if (!account) {
+          console.log('OAUTH CONNECTION - ACCOUNT NOT FOUND')
           const updatedConnection: FluidConnection = {
             ...fluidStatus.connection,
             account: null,
@@ -57,6 +58,7 @@ const ConnectionOAuth: React.FC<ConnectionOAuthProps> = ({
             result: 'error',
           })
         } else {
+          console.log('OAUTH CONNECTION - ACCOUNT FOUND : ', account)
           const triggersServices = new TriggerService(client)
           const trigger: Trigger = await triggersServices.createTrigger(
             account,
diff --git a/src/components/Konnector/KonnectorViewerCard.tsx b/src/components/Konnector/KonnectorViewerCard.tsx
index f837bd05c..5da295ee5 100644
--- a/src/components/Konnector/KonnectorViewerCard.tsx
+++ b/src/components/Konnector/KonnectorViewerCard.tsx
@@ -56,6 +56,7 @@ import UsageEventService from 'services/usageEvent.service'
 import { UsageEventType } from 'enum/usageEvent.enum'
 import PartnersInfoService from 'services/partnersInfo.service'
 import { PartnersInfo } from 'models/partnersInfo.model'
+import log from 'utils/logger'
 
 interface KonnectorViewerCardProps {
   fluidStatus: FluidStatus
@@ -311,6 +312,10 @@ const KonnectorViewerCard: React.FC<KonnectorViewerCardProps> = ({
         fluidStatus.connection.shouldLaunchKonnector &&
         !isKonnectorRunning(trigger)
       ) {
+        console.log('c quoi lembrouille allo quoi')
+        log.info(
+          '[KonnectorViewerCard] about to launch connectionFlow from harvest lib'
+        )
         const connectionFlow = new ConnectionFlow(client, trigger, konnector)
         await connectionFlow.launch()
         connectionFlow.jobWatcher.on(ERROR_EVENT, () => {
diff --git a/src/services/account.service.ts b/src/services/account.service.ts
index c462d91d0..d75083462 100644
--- a/src/services/account.service.ts
+++ b/src/services/account.service.ts
@@ -31,12 +31,7 @@ export default class AccountService {
       konnector,
       accountAuthData
     )
-    const account = await createAccount(
-      this._client,
-      konnector,
-      accountAttributes
-    )
-    return account
+    return createAccount(this._client, konnector, accountAttributes)
   }
 
   public async getAccount(id: string): Promise<Account> {
-- 
GitLab