Vulcan/packages/telescope-comments/lib/custom_fields.js
2016-02-17 12:54:18 +09:00

27 lines
557 B
JavaScript

Posts.addField([
/**
Count of the post's comments
*/
{
fieldName: "commentCount",
fieldSchema: {
type: Number,
optional: true,
public: true
}
},
/**
An array containing the `_id`s of commenters
*/
{
fieldName: "commenters",
fieldSchema: {
type: [String],
optional: true,
public: true
}
}
]);
Telescope.utils.addToFields(Posts.publishedFields.list, ["commentCount", "commenters"]);
Telescope.utils.addToFields(Posts.publishedFields.single, ["commentCount", "commenters"]);