mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 06:23:40 +08:00
Extensibility: params for discussion page API request
This commit is contained in:
parent
6cb1057601
commit
af08ad04fd
@ -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'
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user