mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: handle missing orderedItems property in followers route
This commit is contained in:
@@ -95,13 +95,15 @@ Controller.getFollowers = async (req, res) => {
|
|||||||
url: `${nconf.get('url')}/uid/${req.params.uid}/followers`,
|
url: `${nconf.get('url')}/uid/${req.params.uid}/followers`,
|
||||||
});
|
});
|
||||||
|
|
||||||
collection.orderedItems = collection.orderedItems.map(({ uid }) => {
|
if (collection.hasOwnProperty('orderedItems')) {
|
||||||
if (utils.isNumber(uid)) {
|
collection.orderedItems = collection.orderedItems.map(({ uid }) => {
|
||||||
return `${nconf.get('url')}/uid/${uid}`;
|
if (utils.isNumber(uid)) {
|
||||||
}
|
return `${nconf.get('url')}/uid/${uid}`;
|
||||||
|
}
|
||||||
|
|
||||||
return uid;
|
return uid;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
res.status(200).json(collection);
|
res.status(200).json(collection);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user