mirror of
https://github.com/Redume/Kekkai.git
synced 2025-02-23 12:43:12 +03:00
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
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:
parent
34d216de94
commit
7318b74453
2 changed files with 13 additions and 4 deletions
|
@ -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'];
|
||||
|
|
Loading…
Add table
Reference in a new issue