2017-09-06 10:21:07 -04:00
|
|
|
import { loadTopicView } from 'discourse/models/topic';
|
|
|
|
|
|
|
|
export default Ember.Route.extend({
|
|
|
|
model(params) {
|
|
|
|
let topicRecord = this.store.createRecord('topic', { id: params.id });
|
|
|
|
let topic = loadTopicView(topicRecord).then(() => topicRecord);
|
|
|
|
|
|
|
|
return Ember.RSVP.hash({
|
|
|
|
topic,
|
2017-09-12 13:04:53 -04:00
|
|
|
flaggedPosts: this.store.findAll('flagged-post', {
|
2017-09-08 16:27:07 -04:00
|
|
|
filter: 'active',
|
|
|
|
topic_id: params.id
|
|
|
|
})
|
2017-09-06 10:21:07 -04:00
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
setupController(controller, hash) {
|
|
|
|
controller.setProperties(hash);
|
|
|
|
}
|
|
|
|
});
|