Nicer API for changing discussion request includes (array instead of string)

This commit is contained in:
Toby Zerner 2015-05-14 22:14:21 +09:30
parent 2c0b87f8c2
commit 25dd66028b

View File

@ -32,7 +32,9 @@ export default class DiscussionPage extends Component {
// discussion before), then we can proceed with displaying it immediately. // discussion before), then we can proceed with displaying it immediately.
// If not, we'll make an API request first. // If not, we'll make an API request first.
this.currentNear = m.route.param('near'); this.currentNear = m.route.param('near');
app.store.find('discussions', m.route.param('id'), this.params()).then(this.setupDiscussion.bind(this)); var params = this.params();
params.include = params.include.join(',');
app.store.find('discussions', m.route.param('id'), params).then(this.setupDiscussion.bind(this));
if (app.cache.discussionList) { if (app.cache.discussionList) {
if (!(app.current instanceof DiscussionPage)) { if (!(app.current instanceof DiscussionPage)) {
@ -51,7 +53,7 @@ export default class DiscussionPage extends Component {
params() { params() {
return { return {
near: this.currentNear, near: this.currentNear,
include: 'posts' include: ['posts', 'posts.user']
}; };
} }