feat: expose calculateTopicPostCount and getChildrenTree

v1.18.x
Barış Soner Uşaklı 5 years ago
parent 4fca79380a
commit 437424375e

@ -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) {

Loading…
Cancel
Save