From ecd85f8782c2f892aad92f25a23caa4eaec3d279 Mon Sep 17 00:00:00 2001 From: Pierre-Gilles Leymarie Date: Thu, 6 Jun 2024 18:26:09 +0200 Subject: [PATCH] Revert "Switch to Ecowatt v5 (#163)" This reverts commit f0d3e4f12d9854b3a38072f8574652ce58d85a16. --- core/api/ecowatt/ecowatt.model.js | 2 +- test/core/api/ecowatt/ecowatt.controller.test.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/api/ecowatt/ecowatt.model.js b/core/api/ecowatt/ecowatt.model.js index f9abc74..fc402f7 100644 --- a/core/api/ecowatt/ecowatt.model.js +++ b/core/api/ecowatt/ecowatt.model.js @@ -30,7 +30,7 @@ module.exports = function EcowattModel(logger, redisClient) { }, }); - const { data } = await axios.get('https://digital.iservices.rte-france.com/open_api/ecowatt/v5/signals', { + const { data } = await axios.get('https://digital.iservices.rte-france.com/open_api/ecowatt/v4/signals', { headers: { authorization: `Bearer ${dataToken.access_token}`, }, diff --git a/test/core/api/ecowatt/ecowatt.controller.test.js b/test/core/api/ecowatt/ecowatt.controller.test.js index 2c18bfe..1310ae5 100644 --- a/test/core/api/ecowatt/ecowatt.controller.test.js +++ b/test/core/api/ecowatt/ecowatt.controller.test.js @@ -10,7 +10,7 @@ describe('GET /ecowatt/v4/signals', () => { access_token: 'access_token', expires_in: 100, }); - nock('https://digital.iservices.rte-france.com').get('/open_api/ecowatt/v5/signals').reply(200, { + nock('https://digital.iservices.rte-france.com').get('/open_api/ecowatt/v4/signals').reply(200, { data: true, }); const response = await request(TEST_BACKEND_APP) @@ -52,13 +52,13 @@ describe('GET /ecowatt/v4/signals', () => { access_token: 'access_token', expires_in: 100, }); - nock('https://digital.iservices.rte-france.com').get('/open_api/ecowatt/v5/signals').reply(429, { + nock('https://digital.iservices.rte-france.com').get('/open_api/ecowatt/v4/signals').reply(429, { error: 'too many requests', }); - nock('https://digital.iservices.rte-france.com').get('/open_api/ecowatt/v5/signals').reply(429, { + nock('https://digital.iservices.rte-france.com').get('/open_api/ecowatt/v4/signals').reply(429, { error: 'too many requests', }); - nock('https://digital.iservices.rte-france.com').get('/open_api/ecowatt/v5/signals').reply(200, { + nock('https://digital.iservices.rte-france.com').get('/open_api/ecowatt/v4/signals').reply(200, { data: true, }); const response = await request(TEST_BACKEND_APP)