Set counter name to category id instead of category slug

If using slug, when we edit the category, the slug changes and the counter
become 0 until we refresh the browser. I think it's better if we stick with
_id because _id is not changing.
This commit is contained in:
Riza Fahmi 2016-01-08 08:18:59 +07:00
parent 452e521ee9
commit 869d203917

View file

@ -63,6 +63,6 @@ Categories.helpers({getUrl: function () {return Categories.getUrl(this);}});
* @param {Object} category
*/
Categories.getCounterName = function (category) {
return category.slug + "-postsCount";
return category._id + "-postsCount";
}
Categories.helpers({getCounterName: function () {return Categories.getCounterName(this);}});