mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 19:27:11 +02:00
closes #6884
This commit is contained in:
@@ -176,6 +176,9 @@ module.exports = function (Categories) {
|
||||
async.series(tasks, next);
|
||||
},
|
||||
function (results, next) {
|
||||
copyTagWhitelist(fromCid, toCid, next);
|
||||
},
|
||||
function (next) {
|
||||
Categories.copyPrivilegesFrom(fromCid, toCid, next);
|
||||
},
|
||||
], function (err) {
|
||||
@@ -183,6 +186,22 @@ module.exports = function (Categories) {
|
||||
});
|
||||
};
|
||||
|
||||
function copyTagWhitelist(fromCid, toCid, callback) {
|
||||
var data;
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
db.getSortedSetRangeWithScores('cid:' + fromCid + ':tag:whitelist', 0, -1, next);
|
||||
},
|
||||
function (_data, next) {
|
||||
data = _data;
|
||||
db.delete('cid:' + toCid + ':tag:whitelist', next);
|
||||
},
|
||||
function (next) {
|
||||
db.sortedSetAdd('cid:' + toCid + ':tag:whitelist', data.map(item => item.score), data.map(item => item.value), next);
|
||||
},
|
||||
], callback);
|
||||
}
|
||||
|
||||
Categories.copyPrivilegesFrom = function (fromCid, toCid, callback) {
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
|
||||
Reference in New Issue
Block a user