From 394062ab724de5cdf1c45a5c5e5a6fce14d62611 Mon Sep 17 00:00:00 2001 From: Redume Date: Sun, 18 Feb 2024 14:23:12 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D1=83=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=20=D0=BA=D0=BE=D1=82=D0=BE=D1=80=D0=BE=D0=B9=20=D0=BD?= =?UTF-8?q?=D0=B5=20=D0=B2=D1=81=D0=B5=20=D0=BF=D0=B0=D1=80=D1=8B=20=D0=B2?= =?UTF-8?q?=D0=B0=D0=BB=D1=8E=D1=82=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D1=8F=D0=BB=D1=81=D1=8C=20=D0=B2=20=D0=B1=D0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/saveCourse.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/saveCourse.js b/utils/saveCourse.js index af41d0d..58515ad 100644 --- a/utils/saveCourse.js +++ b/utils/saveCourse.js @@ -2,7 +2,6 @@ const pool = require("../postgresql.js"); const yaml = require("yaml") const fs = require("fs"); const axios = require("axios"); -const {AxiosProxyConfig} = require("axios"); const config = yaml.parse(fs.readFileSync("./config.yaml", "utf-8")); async function saveRate() { @@ -34,9 +33,10 @@ async function saveRate() { const point = data['to'][0]['mid'].toString().indexOf('.') + 4; - pool.query('SELECT * FROM currency WHERE from_currency = $1 AND date = $2', + pool.query('SELECT * FROM currency WHERE from_currency = $1 AND conv_currency = $2 AND date = $3', [ value, + pair, new Date(data['timestamp']).toLocaleDateString() ] ).then(async (db) => {