mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 17:05:51 +01:00
closes #3664
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var async = require('async'),
|
var async = require('async'),
|
||||||
|
_ = require('underscore'),
|
||||||
|
|
||||||
meta = require('../meta'),
|
meta = require('../meta'),
|
||||||
db = require('../database'),
|
db = require('../database'),
|
||||||
@@ -91,7 +92,7 @@ module.exports = function(Posts) {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
function(postData, next) {
|
function(postData, next) {
|
||||||
plugins.fireHook('action:post.save', postData);
|
plugins.fireHook('action:post.save', _.clone(postData));
|
||||||
next(null, postData);
|
next(null, postData);
|
||||||
}
|
}
|
||||||
], callback);
|
], callback);
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var async = require('async'),
|
var async = require('async'),
|
||||||
|
_ = require('underscore'),
|
||||||
|
|
||||||
db = require('../database'),
|
db = require('../database'),
|
||||||
topics = require('../topics'),
|
topics = require('../topics'),
|
||||||
user = require('../user'),
|
user = require('../user'),
|
||||||
@@ -59,7 +61,7 @@ module.exports = function(Posts) {
|
|||||||
},
|
},
|
||||||
function(cid, next) {
|
function(cid, next) {
|
||||||
postData.cid = cid;
|
postData.cid = cid;
|
||||||
plugins.fireHook('action:post.restore', postData);
|
plugins.fireHook('action:post.restore', _.clone(postData));
|
||||||
|
|
||||||
async.parallel([
|
async.parallel([
|
||||||
function(next) {
|
function(next) {
|
||||||
|
|||||||
@@ -32,7 +32,9 @@ module.exports = function(Topics) {
|
|||||||
db.sortedSetRemove('cid:' + topicData.cid + ':pids', pids, next);
|
db.sortedSetRemove('cid:' + topicData.cid + ':pids', pids, next);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
], callback);
|
], function(err, results) {
|
||||||
|
callback(err);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -77,7 +79,9 @@ module.exports = function(Topics) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
], callback);
|
], function(err, results) {
|
||||||
|
callback(err);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ module.exports = function(Topics) {
|
|||||||
uid: uid
|
uid: uid
|
||||||
};
|
};
|
||||||
|
|
||||||
callback(null, data);
|
next(null, data);
|
||||||
}
|
}
|
||||||
], callback);
|
], callback);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user