v1.18.x
barisusakli 10 years ago
parent 7f77269596
commit e023d01616

@ -8,10 +8,15 @@ var async = require('async'),
privileges = require('../privileges'), privileges = require('../privileges'),
plugins = require('../plugins'), plugins = require('../plugins'),
cache = require('./cache'), cache = require('./cache'),
pubsub = require('../pubsub'),
utils = require('../../public/src/utils'); utils = require('../../public/src/utils');
module.exports = function(Posts) { module.exports = function(Posts) {
pubsub.on('post:edit', function(pid) {
cache.del(pid);
});
Posts.edit = function(data, callback) { Posts.edit = function(data, callback) {
var now = Date.now(); var now = Date.now();
var postData; var postData;
@ -58,7 +63,7 @@ module.exports = function(Posts) {
editMainPost(data, postData, next); editMainPost(data, postData, next);
}, },
post: function(next) { post: function(next) {
cache.del(postData.pid); pubsub.publish('post:edit', postData.pid);
Posts.parsePost(postData, next); Posts.parsePost(postData, next);
} }
}, function(err, results) { }, function(err, results) {

Loading…
Cancel
Save