fix(main): if there was no data, an empty array was returned
Some checks are pending
Create and publish a Docker image / build-and-push-server (push) Waiting to run
Create and publish a Docker image / build-and-push-chart (push) Waiting to run
Create and publish a Docker image / build-and-push-CR (push) Waiting to run
Deploy docs / deploy (push) Waiting to run

This commit is contained in:
Данил 2024-10-29 21:19:26 +03:00
parent 34d216de94
commit 7318b74453
2 changed files with 13 additions and 4 deletions

View file

@ -20,7 +20,7 @@ async function getDay(from_currency, conv_currency, date) {
[from_currency.toUpperCase(), conv_currency.toUpperCase(), date],
);
if (!data) return new Error('Missing data');
if (data?.['rows'].length <= 0) return 'Missing data';
const set_date = data['rows'][0]['date'];
data['rows'][0]['date'] = new Date(
@ -58,7 +58,7 @@ async function getPeriod(from_currency, conv_currency, start_date, end_date) {
],
);
if (!data) return new Error('Missing data');
if (data?.['rows'].length <= 0) return 'Missing data';
for (let i = 0; i < data['rows'].length; i++) {
let date = data['rows'][i]['date'];