From 437424375ee521b967bf0c61ef0b227ef6798d40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 14 Sep 2020 14:27:44 -0400 Subject: [PATCH] feat: expose calculateTopicPostCount and getChildrenTree --- src/categories/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/categories/index.js b/src/categories/index.js index 16113d8cc3a8..9480c936bbad 100644 --- a/src/categories/index.js +++ b/src/categories/index.js @@ -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) {