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 {
|
2016-02-17 19:39:43 +09:00
|
|
|
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 {
|
2016-02-17 19:39:43 +09:00
|
|
|
selector: {userId: terms.userId},
|
2015-05-08 09:33:27 +09:00
|
|
|
options: {sort: {postedAt: -1}}
|
2015-05-08 09:20:58 +09:00
|
|
|
};
|
|
|
|
});
|