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