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

36 lines
803 B
JavaScript
Raw Normal View History

2016-06-23 12:17:39 +09:00
import Posts from './collection.js'
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",
"isFuture"
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());
});