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