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