1
0
mirror of https://github.com/flarum/core.git synced 2025-07-20 08:11:27 +02:00

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
// discussion before), then we can proceed with displaying it immediately.
// If not, we'll make an API request first.
app.store.find('discussions', m.route.param('id'), {
near: this.currentNear = m.route.param('near'),
include: 'posts'
}).then(this.setupDiscussion.bind(this));
this.currentNear = m.route.param('near');
app.store.find('discussions', m.route.param('id'), this.params()).then(this.setupDiscussion.bind(this));
if (app.cache.discussionList) {
app.pane.enable();
@@ -48,6 +46,13 @@ export default class DiscussionPage extends Component {
app.composer.minimize();
}
params() {
return {
near: this.currentNear,
include: 'posts'
};
}
/*
*/