Vulcan/packages/nova-posts/lib/published_fields.js

35 lines
782 B
JavaScript
Raw Normal View History

2016-06-15 11:07:10 +09:00
import Posts from './config'
import PublicationsUtils from 'meteor/utilities:smart-publications';
2016-02-17 12:54:18 +09:00
Posts.publishedFields = {};
2016-02-17 11:28:00 +09:00
/**
* @summary Specify which fields should be published by the posts.list publication
2016-02-17 12:54:18 +09:00
* @array Posts.publishedFields.list
2016-02-17 11:28:00 +09:00
*/
Posts.publishedFields.list = PublicationsUtils.arrayToFields([
2016-02-17 11:28:00 +09:00
"_id",
2016-04-01 20:57:50 +09:00
"createdAt",
2016-02-17 11:28:00 +09:00
"postedAt",
"url",
"title",
"slug",
"excerpt",
2016-02-17 11:28:00 +09:00
"viewCount",
"lastCommentedAt",
"clickCount",
"baseScore",
"score",
"status",
"sticky",
"author",
"userId"
2016-02-17 12:54:18 +09:00
]);
2016-02-17 11:28:00 +09:00
/**
* @summary Specify which fields should be published by the posts.single publication
2016-02-17 12:54:18 +09:00
* @array Posts.publishedFields.single
2016-02-17 11:28:00 +09:00
*/
2016-04-05 16:27:48 +09:00
Meteor.startup(() => {
Posts.publishedFields.single = PublicationsUtils.arrayToFields(Posts.getPublishedFields());
});