Skip to content

Commit

Permalink
feat: expose calculateTopicPostCount and getChildrenTree
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Sep 14, 2020
1 parent 4fca793 commit 4374243
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/categories/index.js
Expand Up @@ -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']);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 4374243

Please sign in to comment.