mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 11:45:19 +08:00
21 lines
513 B
JavaScript
21 lines
513 B
JavaScript
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,
|
|
flaggedPosts: this.store.findAll("flagged-post", {
|
|
filter: "active",
|
|
topic_id: params.id
|
|
})
|
|
});
|
|
},
|
|
|
|
setupController(controller, hash) {
|
|
controller.setProperties(hash);
|
|
}
|
|
});
|