Vulcan/packages/vulcan-comments/lib/views.js

22 lines
503 B
JavaScript
Raw Normal View History

2016-06-23 12:17:39 +09:00
import Comments from './collection.js';
2015-05-08 09:20:58 +09:00
// will be common to all other view unless specific properties are overwritten
2017-03-05 10:33:34 +00:00
Comments.addDefaultView(function (terms) {
return {
options: {limit: 1000}
};
});
2015-05-08 09:20:58 +09:00
2017-03-05 10:33:34 +00:00
Comments.addView("postComments", function (terms) {
2015-05-08 09:20:58 +09:00
return {
selector: {postId: terms.postId},
2017-03-05 10:33:34 +00:00
options: {sort: {postedAt: -1}}
2015-05-08 09:20:58 +09:00
};
});
2017-03-05 10:33:34 +00:00
Comments.addView("userComments", function (terms) {
2015-05-08 09:20:58 +09:00
return {
selector: {userId: terms.userId},
options: {sort: {postedAt: -1}}
2015-05-08 09:20:58 +09:00
};
});