mirror of
https://github.com/Redume/Kekkai.git
synced 2025-04-01 21:07:35 +03:00
Fix merge conflicts
Some checks failed
Create and publish a Docker image / build-and-push-server (push) Has been skipped
Create and publish a Docker image / build-and-push-chart (push) Has been skipped
Create and publish a Docker image / detect what files changed (push) Failing after 32s
Create and publish a Docker image / build-and-push-CR (push) Has been skipped
Create and publish a Docker image / build-and-push-web (push) Has been skipped
Some checks failed
Create and publish a Docker image / build-and-push-server (push) Has been skipped
Create and publish a Docker image / build-and-push-chart (push) Has been skipped
Create and publish a Docker image / detect what files changed (push) Failing after 32s
Create and publish a Docker image / build-and-push-CR (push) Has been skipped
Create and publish a Docker image / build-and-push-web (push) Has been skipped
This commit is contained in:
commit
8a0b75e9ea
1 changed files with 19 additions and 11 deletions
|
@ -3,16 +3,24 @@ const config = require('../../shared/config/src/main.js')();
|
||||||
|
|
||||||
module.exports = async function metadata(fastify) {
|
module.exports = async function metadata(fastify) {
|
||||||
fastify.get('/api/metadata/', async function (req, res) {
|
fastify.get('/api/metadata/', async function (req, res) {
|
||||||
const first_date = await pool.query('SELECT * FROM currency ORDER BY date LIMIT 1');
|
const first_date = await pool.query(
|
||||||
const last_date = await pool.query('SELECT * FROM currency ORDER BY date DESC LIMIT 1');
|
'SELECT * FROM currency ORDER BY date LIMIT 1',
|
||||||
|
);
|
||||||
|
const last_date = await pool.query(
|
||||||
|
'SELECT * FROM currency ORDER BY date DESC LIMIT 1',
|
||||||
|
);
|
||||||
|
|
||||||
return res.status(200).send({
|
return res.status(200).send({
|
||||||
'first_date': first_date.rows[0]?.date ? first_date.rows[0]?.date : 'None',
|
first_date: first_date.rows[0]?.date
|
||||||
'last_date': last_date.rows[0]?.date ? last_date.rows[0]?.date : 'None',
|
? first_date.rows[0]?.date
|
||||||
'currencies': {
|
: 'None',
|
||||||
'crypto': config['currency']['crypto'],
|
last_date: last_date.rows[0]?.date
|
||||||
'fiat': config['currency']['fiat'],
|
? last_date.rows[0]?.date
|
||||||
}
|
: 'None',
|
||||||
})
|
currencies: {
|
||||||
|
crypto: config['currency']['crypto'],
|
||||||
|
fiat: config['currency']['fiat'],
|
||||||
|
},
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue