mirror of
https://github.com/vale981/Vulcan
synced 2025-03-11 13:06:41 -04:00
46 lines
841 B
JavaScript
46 lines
841 B
JavaScript
![]() |
Telescope.settings.addField([
|
||
|
/**
|
||
|
How many upvotes the post has received
|
||
|
*/
|
||
|
{
|
||
|
fieldName: "upvotes",
|
||
|
fieldSchema: {
|
||
|
type: Number,
|
||
|
optional: true
|
||
|
}
|
||
|
},
|
||
|
/**
|
||
|
An array containing the `_id`s of the post's upvoters
|
||
|
*/
|
||
|
{
|
||
|
fieldName: "upvoters",
|
||
|
fieldSchema: {
|
||
|
type: [String],
|
||
|
optional: true
|
||
|
}
|
||
|
},
|
||
|
/**
|
||
|
How many downvotes the post has received
|
||
|
*/
|
||
|
{
|
||
|
fieldName: "downvotes",
|
||
|
fieldSchema: {
|
||
|
type: Number,
|
||
|
optional: true
|
||
|
}
|
||
|
},
|
||
|
/**
|
||
|
An array containing the `_id`s of the post's downvoters
|
||
|
*/
|
||
|
{
|
||
|
fieldName: "downvoters",
|
||
|
fieldSchema: {
|
||
|
type: [String],
|
||
|
optional: true
|
||
|
}
|
||
|
},
|
||
|
]);
|
||
|
|
||
|
Posts.publicationFields.list.push("upvotes", "downvotes");
|
||
|
Posts.publicationFields.single.push("upvotes", "upvoters", "downvotes", "downvoters");
|