From d7228683a51d5721eb544432805fd633a25fccff Mon Sep 17 00:00:00 2001 From: Emanuele Liardo Date: Tue, 22 Oct 2024 09:48:43 +0200 Subject: [PATCH] fix lint (#121) --- index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index f4fe45d..4ddb126 100644 --- a/index.js +++ b/index.js @@ -38,7 +38,12 @@ function checkParams(input, period, interval, pointscount) { * @return {Promise} An array of arrays with date (timestamp) and values (number) properties */ async function callInvesting(pairId, period, interval, pointscount) { - const url = `https://api.investing.com/api/financialdata/${pairId}/historical/chart?period=${period}&interval=${interval}&pointscount=${pointscount}`; + const query = new URLSearchParams({ + period, + interval, + pointscount, + }); + const url = `https://api.investing.com/api/financialdata/${pairId}/historical/chart?${query}`; const response = await fetch(url, { headers: new Headers({