mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 19:15:58 +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`, | ||||
| 	}); | ||||
|  | ||||
| 	collection.orderedItems = collection.orderedItems.map(({ uid }) => { | ||||
| 		if (utils.isNumber(uid)) { | ||||
| 			return `${nconf.get('url')}/uid/${uid}`; | ||||
| 		} | ||||
| 	if (collection.hasOwnProperty('orderedItems')) { | ||||
| 		collection.orderedItems = collection.orderedItems.map(({ uid }) => { | ||||
| 			if (utils.isNumber(uid)) { | ||||
| 				return `${nconf.get('url')}/uid/${uid}`; | ||||
| 			} | ||||
|  | ||||
| 		return uid; | ||||
| 	}); | ||||
| 			return uid; | ||||
| 		}); | ||||
| 	} | ||||
|  | ||||
| 	res.status(200).json(collection); | ||||
| }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user