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