ForEach fix with Issue #1

ForEach fix with Issue #1
pull/47/head
ShahanaFarooqui 6 years ago
parent 25da5fbc9b
commit 530ca2becb

@ -15,9 +15,11 @@ exports.getPayments = (req, res, next) => {
error: (undefined === body || search_idx > -1) ? 'Error From Server!' : body.error
});
} else {
body.payments.forEach(payment => {
payment.creation_date_str = (undefined === payment.creation_date) ? '' : common.convertTimestampToDate(payment.creation_date);
});
if (undefined !== body.payments) {
body.payments.forEach(payment => {
payment.creation_date_str = (undefined === payment.creation_date) ? '' : common.convertTimestampToDate(payment.creation_date);
});
}
res.status(200).json(body.payments);
}
});

Loading…
Cancel
Save