mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 23:14:20 +08:00
22 lines
551 B
JavaScript
22 lines
551 B
JavaScript
import { loadTopicView } from 'discourse/models/topic';
|
|
import FlaggedPost from 'admin/models/flagged-post';
|
|
|
|
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,
|
|
flaggedPosts: FlaggedPost.findAll({
|
|
filter: 'active',
|
|
topic_id: params.id
|
|
})
|
|
});
|
|
},
|
|
|
|
setupController(controller, hash) {
|
|
controller.setProperties(hash);
|
|
}
|
|
});
|