mirror of
https://github.com/Redume/Kekkai.git
synced 2025-02-23 20:51:25 +03:00
Исправил баг. Ранее если не было валюты в бд, но все равно выдавало график. Исправлено
This commit is contained in:
parent
2880f2b4c1
commit
5bbb422495
1 changed files with 1 additions and 2 deletions
|
@ -21,7 +21,7 @@ async function gen_chart(from_currency, conv_currency, start_date, end_date) {
|
|||
end_date
|
||||
]);
|
||||
|
||||
if (!data) return new Error('Missing data');
|
||||
if (!data['rows'][0]) return 'Missing data';
|
||||
|
||||
const date = [];
|
||||
const rate = [];
|
||||
|
@ -54,7 +54,6 @@ async function gen_chart(from_currency, conv_currency, start_date, end_date) {
|
|||
labels: date,
|
||||
datasets: [
|
||||
{
|
||||
label: 'rate',
|
||||
borderColor: rate[0] < rate[rate.length-1] ? 'rgb(24, 218, 39)' : 'rgb(243, 85, 50)',
|
||||
backgroundColor: rate[0] < rate[rate.length-1] ? 'rgb(36, 175, 47)' : 'rgb(218, 56, 24)',
|
||||
data: rate,
|
||||
|
|
Loading…
Add table
Reference in a new issue