Vulcan/packages/example-forum/lib/modules/comments/views.js

28 lines
522 B
JavaScript
Raw Normal View History

2017-09-04 18:37:21 +09:00
/*
Comments views
*/
import Comments from './index.js';
// will be common to all other view unless specific properties are overwritten
Comments.addDefaultView(function (terms) {
return {
options: {limit: 1000}
};
});
Comments.addView("postComments", function (terms) {
return {
selector: {postId: terms.postId},
options: {sort: {postedAt: -1}}
};
});
Comments.addView("userComments", function (terms) {
return {
selector: {userId: terms.userId},
options: {sort: {postedAt: -1}}
};
});