mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-12 11:01:52 +00:00
if no nodes return nothing for getDeviceDetails #6637
Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
parent
d1cb184e9e
commit
e66776c5da
1 changed files with 36 additions and 32 deletions
|
@ -8049,6 +8049,9 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
||||||
parent.common.unEscapeAllLinksFieldName(docs);
|
parent.common.unEscapeAllLinksFieldName(docs);
|
||||||
|
|
||||||
var results = [], resultPendingCount = 0;
|
var results = [], resultPendingCount = 0;
|
||||||
|
if (docs.length == 0) { // no results return blank array
|
||||||
|
func(docs, type);
|
||||||
|
} else {
|
||||||
for (i in docs) {
|
for (i in docs) {
|
||||||
// Check device links, if a link points to an unknown user, remove it.
|
// Check device links, if a link points to an unknown user, remove it.
|
||||||
parent.cleanDevice(docs[i]);
|
parent.cleanDevice(docs[i]);
|
||||||
|
@ -8086,6 +8089,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
||||||
getNodeFunc.nodeid = docs[i]._id;
|
getNodeFunc.nodeid = docs[i]._id;
|
||||||
parent.GetNodeWithRights(domain, user, docs[i]._id, getNodeFunc);
|
parent.GetNodeWithRights(domain, user, docs[i]._id, getNodeFunc);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// If we are paging, we know what devices the user is look at
|
// If we are paging, we know what devices the user is look at
|
||||||
|
|
Loading…
Reference in a new issue