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

21 lines
352 B
JavaScript
Raw Normal View History

2017-09-04 18:37:21 +09:00
/*
Comments views
*/
import Comments from './index.js';
2017-09-15 10:08:23 +02:00
Comments.addView('postComments', function (terms) {
2017-09-04 18:37:21 +09:00
return {
selector: {postId: terms.postId},
options: {sort: {postedAt: -1}}
};
});
2017-09-15 10:08:23 +02:00
Comments.addView('userComments', function (terms) {
2017-09-04 18:37:21 +09:00
return {
selector: {userId: terms.userId},
options: {sort: {postedAt: -1}}
};
});