mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 02:55:58 +01:00 
			
		
		
		
	Categories optimize (#6999)
* WIP * fix category page * fix counts, and copyPrivileges * fix lint * more fixes, * redis fix * fix test * fix category test * remove getParentsAndChildren
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							96a2be9b55
						
					
				
				
					commit
					53ad2bbd6e
				
			| @@ -14,6 +14,7 @@ categoriesController.get = function (req, res, callback) { | ||||
| 		function (next) { | ||||
| 			async.parallel({ | ||||
| 				category: async.apply(categories.getCategories, [req.params.category_id], req.uid), | ||||
| 				parent: async.apply(categories.getParent, [req.params.category_id]), | ||||
| 				allCategories: async.apply(categories.buildForSelect, req.uid, 'read'), | ||||
| 			}, next); | ||||
| 		}, | ||||
| @@ -23,7 +24,7 @@ categoriesController.get = function (req, res, callback) { | ||||
| 			if (!category) { | ||||
| 				return callback(); | ||||
| 			} | ||||
|  | ||||
| 			category.parent = data.parent[0]; | ||||
| 			data.allCategories.forEach(function (category) { | ||||
| 				if (category) { | ||||
| 					category.selected = parseInt(category.cid, 10) === parseInt(req.params.category_id, 10); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user