Issue #14 Fix: Peer Added in the table

Issue #14 Fix: Peer Added in the table
This commit is contained in:
ShahanaFarooqui 2018-12-19 20:54:52 -05:00
parent e6c5b10be2
commit df3e656473
3 changed files with 14 additions and 2 deletions

View File

@ -9,5 +9,5 @@
<link rel="stylesheet" href="styles.e4aab088ea7dc1035ccf.css"></head>
<body>
<rtl-app></rtl-app>
<script type="text/javascript" src="runtime.ec2944dd8b20ec099bf3.js"></script><script type="text/javascript" src="polyfills.b2575713cefb95077d85.js"></script><script type="text/javascript" src="main.e133f67d8d6cefff7cc0.js"></script></body>
<script type="text/javascript" src="runtime.ec2944dd8b20ec099bf3.js"></script><script type="text/javascript" src="polyfills.b2575713cefb95077d85.js"></script><script type="text/javascript" src="main.878d0165b8c37c9796f3.js"></script></body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -48,7 +48,18 @@ exports.postPeer = (req, res, next) => {
error: (undefined === body) ? 'Error From Server!' : body.error
});
} else {
res.status(201).json({message: 'Peer Added!'});
options.url = common.lnd_server_url + '/peers';
request(options).then(function (body) {
let peers = (undefined === body.peers) ? [] : body.peers;
Promise.all(
peers.map(peer => {
return getAliasForPeers(peer);
}))
.then(function(values) {
console.log(`\nPeers Fetched with Alias: ${JSON.stringify(body)}`);
res.status(201).json(body.peers);
});
})
}
});
};