mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
feat: expose calculateTopicPostCount and getChildrenTree
This commit is contained in:
@@ -188,6 +188,7 @@ function calculateTopicPostCount(category) {
|
||||
category.totalPostCount = postCount;
|
||||
category.totalTopicCount = topicCount;
|
||||
}
|
||||
Categories.calculateTopicPostCount = calculateTopicPostCount;
|
||||
|
||||
Categories.getParents = async function (cids) {
|
||||
const categoriesData = await Categories.getCategoriesFields(cids, ['parentCid']);
|
||||
@@ -225,6 +226,8 @@ async function getChildrenTree(category, uid) {
|
||||
Categories.getTree([category].concat(childrenData), category.parentCid);
|
||||
}
|
||||
|
||||
Categories.getChildrenTree = getChildrenTree;
|
||||
|
||||
Categories.getChildrenCids = async function (rootCid) {
|
||||
let allCids = [];
|
||||
async function recursive(keys) {
|
||||
|
||||
Reference in New Issue
Block a user