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

@@ -53,17 +53,11 @@ module.exports = function(Categories) {
}
if (category.description) {
plugins.fireHook('filter:parse.raw', category.description, function(err, parsedDescription) {
if (err) {
return callback(err);
}
category.descriptionParsed = parsedDescription;
category.description = validator.escape(category.description);
callback(null, category);
});
} else {
callback(null, category);
category.description = validator.escape(category.description);
category.descriptionParsed = category.descriptionParsed || category.description;
}
callback(null, category);
}
Categories.getCategoryField = function(cid, field, callback) {