mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: #10692
This commit is contained in:
@@ -113,6 +113,13 @@ module.exports = function (Topics) {
|
||||
await db.sortedSetAdd('tags:topic:count', 0, tag);
|
||||
cache.del('tags:topic:count');
|
||||
}
|
||||
const allCids = await categories.getAllCidsFromSet('categories:cid');
|
||||
const isMembers = await db.isMemberOfSortedSets(
|
||||
allCids.map(cid => `cid:${cid}:tags`), tag
|
||||
);
|
||||
const bulkAdd = allCids.filter((cid, index) => !isMembers[index])
|
||||
.map(cid => ([`cid:${cid}:tags`, 0, tag]));
|
||||
await db.sortedSetAddBulk(bulkAdd);
|
||||
};
|
||||
|
||||
Topics.renameTags = async function (data) {
|
||||
|
||||
Reference in New Issue
Block a user