2019-10-22 21:46:10 +08:00
|
|
|
import DiscourseRoute from "discourse/routes/discourse";
|
2017-06-29 04:56:44 +08:00
|
|
|
import WatchedWord from "admin/models/watched-word";
|
|
|
|
|
2019-10-22 21:46:10 +08:00
|
|
|
export default DiscourseRoute.extend({
|
2017-06-29 04:56:44 +08:00
|
|
|
queryParams: {
|
|
|
|
filter: { replace: true }
|
|
|
|
},
|
|
|
|
|
|
|
|
model() {
|
|
|
|
return WatchedWord.findAll();
|
|
|
|
},
|
|
|
|
|
2017-09-28 03:48:57 +08:00
|
|
|
setupController(controller, model) {
|
|
|
|
controller.set("model", model);
|
|
|
|
if (model && model.length) {
|
|
|
|
controller.set("regularExpressions", model[0].get("regularExpressions"));
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2017-06-29 04:56:44 +08:00
|
|
|
afterModel(watchedWordsList) {
|
|
|
|
this.controllerFor("adminWatchedWords").set(
|
|
|
|
"allWatchedWords",
|
|
|
|
watchedWordsList
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|