mirror of
https://github.com/flarum/framework.git
synced 2025-02-22 07:19:56 +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
|
// 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'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user