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

fix wso2BaseUrl ends with /

parent 6a4af556
No related branches found
No related tags found
1 merge request!24Draft: Resolve "wso2BaseUrl ends with /"
Pipeline #45988 passed
...@@ -6,6 +6,7 @@ const { ...@@ -6,6 +6,7 @@ const {
addData, addData,
errors, errors,
} = require('cozy-konnector-libs') } = require('cozy-konnector-libs')
const path = require('node:path')
const soapRequest = require('easy-soap-request') const soapRequest = require('easy-soap-request')
const moment = require('moment') const moment = require('moment')
require('moment-timezone') require('moment-timezone')
...@@ -276,25 +277,17 @@ async function deleteConsent( ...@@ -276,25 +277,17 @@ async function deleteConsent(
*/ */
async function gatherData(baseUrl, apiAuthKey, sgeLogin, pointId) { async function gatherData(baseUrl, apiAuthKey, sgeLogin, pointId) {
log('info', 'Querying data...') log('info', 'Querying data...')
const measuresUrl = new URL(
path.resolve(
new URL(baseUrl).pathname,
'/enedis_SGE_ConsultationMesuresDetaillees/1.0'
),
baseUrl
).href
await getContractStartDate(baseUrl, apiAuthKey, sgeLogin, pointId) await getContractStartDate(baseUrl, apiAuthKey, sgeLogin, pointId)
await getData( await getData(measuresUrl, apiAuthKey, sgeLogin, pointId)
`${baseUrl}/enedis_SGE_ConsultationMesuresDetaillees/1.0`, await getMaxPowerData(measuresUrl, apiAuthKey, sgeLogin, pointId)
apiAuthKey, await getDataHalfHour(measuresUrl, apiAuthKey, sgeLogin, pointId)
sgeLogin,
pointId
)
await getMaxPowerData(
`${baseUrl}/enedis_SGE_ConsultationMesuresDetaillees/1.0`,
apiAuthKey,
sgeLogin,
pointId
)
await getDataHalfHour(
`${baseUrl}/enedis_SGE_ConsultationMesuresDetaillees/1.0`,
apiAuthKey,
sgeLogin,
pointId
)
log('info', 'Querying data: done') log('info', 'Querying data: done')
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment