mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 20:45:58 +01:00
cleanup in move rencet replies'
This commit is contained in:
@@ -290,21 +290,16 @@ var db = require('./database'),
|
||||
|
||||
db.sortedSetRemove('categories:recent_posts:cid:' + oldCid, pid);
|
||||
db.sortedSetAdd('categories:recent_posts:cid:' + cid, timestamp, pid);
|
||||
callback(null);
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
topics.getPids(tid, function(err, pids) {
|
||||
if(err) {
|
||||
return callback(err, null);
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
async.each(pids, movePost, function(err) {
|
||||
if(err) {
|
||||
return callback(err, null);
|
||||
}
|
||||
callback(null, 1);
|
||||
});
|
||||
async.each(pids, movePost, callback);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -206,19 +206,14 @@ var winston = require('winston'),
|
||||
|
||||
topics.setTopicField(tid, 'cid', cid);
|
||||
|
||||
categories.moveActiveUsers(tid, oldCid, cid);
|
||||
categories.moveRecentReplies(tid, oldCid, cid, function(err, data) {
|
||||
if (err) {
|
||||
winston.err(err);
|
||||
}
|
||||
});
|
||||
|
||||
if(!parseInt(topic.deleted, 10)) {
|
||||
categories.incrementCategoryFieldBy(oldCid, 'topic_count', -1);
|
||||
categories.incrementCategoryFieldBy(cid, 'topic_count', 1);
|
||||
}
|
||||
|
||||
callback(null);
|
||||
categories.moveActiveUsers(tid, oldCid, cid);
|
||||
|
||||
categories.moveRecentReplies(tid, oldCid, cid, callback);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user