mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 14:35:47 +01:00
first pass #899
This commit is contained in:
@@ -75,10 +75,6 @@ var winston = require('winston'),
|
||||
|
||||
events.logPostEdit(uid, pid);
|
||||
|
||||
db.searchRemove('post', pid, function() {
|
||||
db.searchIndex('post', content, pid);
|
||||
});
|
||||
|
||||
async.parallel([
|
||||
function(next) {
|
||||
posts.getPostField(pid, 'tid', function(err, tid) {
|
||||
@@ -89,12 +85,12 @@ var winston = require('winston'),
|
||||
|
||||
topics.setTopicField(tid, 'title', title);
|
||||
topics.setTopicField(tid, 'slug', slug);
|
||||
|
||||
db.searchRemove('topic', tid, function() {
|
||||
db.searchIndex('topic', title, tid);
|
||||
});
|
||||
}
|
||||
|
||||
posts.getPostData(pid, function(err, postData) {
|
||||
plugins.fireHook('action:post.edit', postData);
|
||||
});
|
||||
|
||||
next(null, {
|
||||
tid: tid,
|
||||
isMainPost: isMainPost
|
||||
@@ -129,7 +125,8 @@ var winston = require('winston'),
|
||||
var success = function() {
|
||||
posts.setPostField(pid, 'deleted', 1);
|
||||
db.decrObjectField('global', 'postCount');
|
||||
db.searchRemove('post', pid);
|
||||
|
||||
plugins.fireHook('action:post.delete', pid);
|
||||
|
||||
events.logPostDelete(uid, pid);
|
||||
|
||||
@@ -205,7 +202,7 @@ var winston = require('winston'),
|
||||
});
|
||||
|
||||
|
||||
db.searchIndex('post', postData.content, pid);
|
||||
plugins.fireHook('action:post.restore', postData);
|
||||
|
||||
// Restore topic if it is the only post
|
||||
topics.getTopicField(postData.tid, 'postcount', function(err, count) {
|
||||
|
||||
Reference in New Issue
Block a user