mirror of
https://github.com/dec0dOS/zero-ui.git
synced 2025-07-07 21:41:41 -07:00
fix: fix network member api resp handling
filter controller peer handle undefined write exp msg to error msg
This commit is contained in:
parent
db8f4979e6
commit
856682bad1
2 changed files with 21 additions and 11 deletions
|
@ -12,12 +12,12 @@ router.get("/", auth.isAuthorized, async function (req, res) {
|
|||
api
|
||||
.get("controller/network/" + nwid + "/member")
|
||||
.then(async function (controllerRes) {
|
||||
const mids = Object.keys(controllerRes.data);
|
||||
const mids = controllerRes.data.map((i) => Object.keys(i)[0]);
|
||||
const data = await member.getMembersData(nwid, mids);
|
||||
res.send(data);
|
||||
})
|
||||
.catch(function () {
|
||||
res.status(404).send({ error: "Network not found" });
|
||||
.catch(function (err) {
|
||||
res.status(404).send({ error: `Network not found ${err}` });
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue