Skip to content
Snippets Groups Projects
Commit 09c6ef54 authored by Bastien DUMONT's avatar Bastien DUMONT :angel:
Browse files

chore: fix standalone

parent 54d4f5ae
No related branches found
No related tags found
1 merge request!322.0 Release
Pipeline #96878 passed
......@@ -8,7 +8,7 @@ const {
log
} = require('cozy-konnector-libs')
const getDataGenericErrors = require('./helpers/getDataGenericErrors')
const { isDev } = require('./helpers/env')
const { isDev, isLocal } = require('./helpers/env')
const moment = require('moment')
require('moment-timezone')
moment.locale('fr') // set the language
......@@ -49,7 +49,7 @@ const manualExecution = process.env.COZY_JOB_MANUAL_EXECUTION === 'true'
const startDate = moment().subtract(manualExecution ? 1 : 3, 'year')
const endDate = moment().startOf('day')
const ACCOUNT_ID = 'grdfgrandlyon'
const ACCOUNT_ID = isLocal() ? 'default_account_id' : 'grdfgrandlyon'
module.exports = new BaseKonnector(start)
......@@ -89,7 +89,7 @@ async function handleConsents(consents, boBaseUrl, boToken) {
if (consents.some(consent => consent.etat_droit_acces === 'Refusée')) {
log('info', 'Found consent "Refusée"')
const accountData = await getAccount(ACCOUNT_ID)
if (accountData.data.consentId) {
if (accountData?.data?.consentId) {
await deleteBoConsent({
boBaseUrl,
boToken,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment