performance improvements

store parsed category description
removed mongo _key from returns
dont get category teaser for parent
This commit is contained in:
barisusakli
2015-10-18 18:30:17 -04:00
parent e2f590e0b4
commit 53d29e29af
6 changed files with 105 additions and 102 deletions

View File

@@ -68,6 +68,8 @@ module.exports = function(Categories) {
if (key === 'order') {
updateOrder(cid, value, callback);
} else if (key === 'description') {
parseDescription(cid, value, callback);
} else {
callback();
}
@@ -119,4 +121,13 @@ module.exports = function(Categories) {
});
}
function parseDescription(cid, description, callback) {
plugins.fireHook('filter:parse.raw', description, function(err, parsedDescription) {
if (err) {
return callback(err);
}
Categories.setCategoryField(cid, 'descriptionParsed', parsedDescription, callback);
});
}
};