Extensibility: params for discussion page API request

This commit is contained in:
Toby Zerner 2015-05-02 08:38:05 +09:30
parent 6cb1057601
commit af08ad04fd

View File

@ -32,10 +32,8 @@ export default class DiscussionPage extends Component {
// its posts relationship has been loaded (i.e. we've viewed this // its posts relationship has been loaded (i.e. we've viewed this
// 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.
app.store.find('discussions', m.route.param('id'), { this.currentNear = m.route.param('near');
near: this.currentNear = m.route.param('near'), app.store.find('discussions', m.route.param('id'), this.params()).then(this.setupDiscussion.bind(this));
include: 'posts'
}).then(this.setupDiscussion.bind(this));
if (app.cache.discussionList) { if (app.cache.discussionList) {
app.pane.enable(); app.pane.enable();
@ -48,6 +46,13 @@ export default class DiscussionPage extends Component {
app.composer.minimize(); app.composer.minimize();
} }
params() {
return {
near: this.currentNear,
include: 'posts'
};
}
/* /*
*/ */