Skip to content

Commit de5aba3

Browse files
chart indicator update
1 parent e7b308d commit de5aba3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/controllers/Display.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,9 @@ function DisplayController() {
559559
};
560560

561561
this.getIndicators = async (req, res, next) => {
562-
const data = await getIndicatorsData();
562+
const {symbol, interval} = req.query
563+
console.log(symbol, interval);
564+
const data = await getIndicatorsData(`https://api3.binance.com/api/v3/klines?symbol=${symbol}&interval=${interval}`);
563565
return res.status(200).json({
564566
message: "successfully",
565567
error: null,

src/services/crudDatabase/user.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -590,10 +590,8 @@ export const getLengthOfTransactionsList = async () => {
590590
}
591591
};
592592

593-
export const getIndicatorsData = async () => {
594-
const resp = await got(
595-
`https://api.binance.com/api/v3/klines?symbol=BTCUSDT&interval=1d`
596-
);
593+
export const getIndicatorsData = async (urlApis) => {
594+
const resp = await got(urlApis);
597595
const data = JSON.parse(resp.body);
598596
let klinedata = data.map((d) => ({
599597
time: d[0] / 1000,

0 commit comments

Comments
 (0)