|
|
@ -55,13 +55,14 @@ export const listInvoices = (req, res, next) => {
|
|
|
|
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Invoices', msg: 'Getting List Invoices..' });
|
|
|
|
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Invoices', msg: 'Getting List Invoices..' });
|
|
|
|
options = common.getOptions(req);
|
|
|
|
options = common.getOptions(req);
|
|
|
|
if (options.error) { return res.status(options.statusCode).json({ message: options.message, error: options.error }); }
|
|
|
|
if (options.error) { return res.status(options.statusCode).json({ message: options.message, error: options.error }); }
|
|
|
|
options.form = {};
|
|
|
|
const tillToday = (Math.round(new Date(Date.now()).getTime() / 1000)).toString();
|
|
|
|
|
|
|
|
options.form = { from: 0, to: tillToday };
|
|
|
|
const options1 = JSON.parse(JSON.stringify(options));
|
|
|
|
const options1 = JSON.parse(JSON.stringify(options));
|
|
|
|
options1.url = req.session.selectedNode.ln_server_url + '/listinvoices';
|
|
|
|
options1.url = req.session.selectedNode.ln_server_url + '/listinvoices';
|
|
|
|
options1.form = {};
|
|
|
|
options1.form = { from: 0, to: tillToday };
|
|
|
|
const options2 = JSON.parse(JSON.stringify(options));
|
|
|
|
const options2 = JSON.parse(JSON.stringify(options));
|
|
|
|
options2.url = req.session.selectedNode.ln_server_url + '/listpendinginvoices';
|
|
|
|
options2.url = req.session.selectedNode.ln_server_url + '/listpendinginvoices';
|
|
|
|
options2.form = {};
|
|
|
|
options2.form = { from: 0, to: tillToday };
|
|
|
|
if (common.read_dummy_data) {
|
|
|
|
if (common.read_dummy_data) {
|
|
|
|
return common.getDummyData('Invoices', req.session.selectedNode.ln_implementation).then((body) => {
|
|
|
|
return common.getDummyData('Invoices', req.session.selectedNode.ln_implementation).then((body) => {
|
|
|
|
const invoices = (!body[0] || body[0].length <= 0) ? [] : body[0];
|
|
|
|
const invoices = (!body[0] || body[0].length <= 0) ? [] : body[0];
|
|
|
|