Skip to content
Snippets Groups Projects

Draft: Resolve "wso2BaseUrl ends with /"

Closed Bastien DUMONT requested to merge 4-wso2baseurl-ends-with into main
1 file
+ 11
18
Compare changes
  • Side-by-side
  • Inline
+ 11
18
@@ -6,6 +6,7 @@ const {
addData,
errors,
} = require('cozy-konnector-libs')
const path = require('node:path')
const soapRequest = require('easy-soap-request')
const moment = require('moment')
require('moment-timezone')
@@ -276,25 +277,17 @@ async function deleteConsent(
*/
async function gatherData(baseUrl, apiAuthKey, sgeLogin, pointId) {
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 getData(
`${baseUrl}/enedis_SGE_ConsultationMesuresDetaillees/1.0`,
apiAuthKey,
sgeLogin,
pointId
)
await getMaxPowerData(
`${baseUrl}/enedis_SGE_ConsultationMesuresDetaillees/1.0`,
apiAuthKey,
sgeLogin,
pointId
)
await getDataHalfHour(
`${baseUrl}/enedis_SGE_ConsultationMesuresDetaillees/1.0`,
apiAuthKey,
sgeLogin,
pointId
)
await getData(measuresUrl, apiAuthKey, sgeLogin, pointId)
await getMaxPowerData(measuresUrl, apiAuthKey, sgeLogin, pointId)
await getDataHalfHour(measuresUrl, apiAuthKey, sgeLogin, pointId)
log('info', 'Querying data: done')
}
Loading