mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 14:05:46 +01:00
performance improvements
store parsed category description removed mongo _key from returns dont get category teaser for parent
This commit is contained in:
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user