From 43b1612e772fa7000e562bb34d7637faa0674f34 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Wed, 8 Nov 2023 19:46:09 -0800 Subject: [PATCH] empty bolt memo fix --- backend/controllers/cln/payments.js | 2 +- server/controllers/cln/payments.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/controllers/cln/payments.js b/backend/controllers/cln/payments.js index 8d25bc8e..64b905fb 100644 --- a/backend/controllers/cln/payments.js +++ b/backend/controllers/cln/payments.js @@ -89,7 +89,7 @@ export const listPayments = (req, res, next) => { request.post(options).then((body) => { logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Payments', msg: 'Payment List Received', data: body.payments }); body.payments = body.payments && body.payments.length && body.payments.length > 0 ? groupBy(body.payments) : []; - return Promise.all(body.payments?.map((payment) => getMemo(req.session.selectedNode, payment))).then((values) => { + return Promise.all(body.payments?.map((payment) => ((payment.bolt11) ? getMemo(req.session.selectedNode, payment) : (payment.memo = '')))).then((values) => { logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Payments', msg: 'Payments List with Memo Received', data: body.payments }); res.status(200).json(body.payments); }); diff --git a/server/controllers/cln/payments.ts b/server/controllers/cln/payments.ts index 1ff63483..afb3e3ba 100644 --- a/server/controllers/cln/payments.ts +++ b/server/controllers/cln/payments.ts @@ -82,7 +82,7 @@ export const listPayments = (req, res, next) => { request.post(options).then((body) => { logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Payments', msg: 'Payment List Received', data: body.payments }); body.payments = body.payments && body.payments.length && body.payments.length > 0 ? groupBy(body.payments) : []; - return Promise.all(body.payments?.map((payment) => getMemo(req.session.selectedNode, payment))).then((values) => { + return Promise.all(body.payments?.map((payment) => ((payment.bolt11) ? getMemo(req.session.selectedNode, payment) : (payment.memo = '')))).then((values) => { logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Payments', msg: 'Payments List with Memo Received', data: body.payments }); res.status(200).json(body.payments); });