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