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

21 lines
356 B
JavaScript
Raw Normal View History

2017-09-04 18:37:21 +09:00
/*
Comments views
*/
2017-09-29 09:19:23 +09:00
import { Comments } from './index.js';
2017-09-04 18:37:21 +09:00
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}}
};
});