mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-08-13 01:48:42 +02:00
feat: add tracking categories and make watching send notifications (#12147)
* feat: add tracking categories and make watching send notifications upgrade script to change the defaults * add missing spec * test: one more spec
This commit is contained in:
committed by
GitHub
parent
f8cc8548bb
commit
84fed97b41
@@ -60,10 +60,10 @@ module.exports = function (User) {
|
||||
};
|
||||
|
||||
User.getCategoriesByStates = async function (uid, states) {
|
||||
if (!(parseInt(uid, 10) > 0)) {
|
||||
return await categories.getAllCidsFromSet('categories:cid');
|
||||
}
|
||||
const cids = await categories.getAllCidsFromSet('categories:cid');
|
||||
if (!(parseInt(uid, 10) > 0)) {
|
||||
return cids;
|
||||
}
|
||||
const userState = await categories.getWatchState(cids, uid);
|
||||
return cids.filter((cid, index) => states.includes(userState[index]));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user