mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-05 05:25:49 +01:00
feat: #7964, change all categories at once
allow passing cids to setCategoryWatchState and category.exists
This commit is contained in:
@@ -23,6 +23,9 @@ require('./update')(Categories);
|
||||
require('./watch')(Categories);
|
||||
|
||||
Categories.exists = async function (cid) {
|
||||
if (Array.isArray(cid)) {
|
||||
return await db.exists(cid.map(cid => 'category:' + cid));
|
||||
}
|
||||
return await db.exists('category:' + cid);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user