INNER CODE UNIT · JavaScript

cids

NodeBB/NodeBB · src/categories/index.js:101

	const cids = await cache.get(key, () => db.getSortedSetRange(key, 0, -1));
	return cids.slice();
};

Categories.getAllCategories = async function () {
	const cids = await Categories.getAllCidsFromSet('categories:cid');
	return await Categories.getCategories(cids);
};

Categories.getCidsByPrivilege = async function (set, uid, privilege) {
	const cids = await Categories.getAllCidsFromSet(set);
	if (set === 'categories:cid') {
		cids.unshift(-1);
	}

	return await privileges.categories.filterCids(privilege, cids, uid);
};

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…