2019-10-24 00:39:32 +08:00
|
|
|
import Route from "@ember/routing/route";
|
2020-07-07 17:44:13 +08:00
|
|
|
import { action } from "@ember/object";
|
|
|
|
|
2019-10-24 00:39:32 +08:00
|
|
|
export default Route.extend({
|
2015-11-13 05:08:19 +08:00
|
|
|
model() {
|
|
|
|
return this.store.findAll("email-template");
|
|
|
|
},
|
|
|
|
|
|
|
|
setupController(controller, model) {
|
|
|
|
controller.set("emailTemplates", model);
|
2020-07-07 17:44:13 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
@action
|
|
|
|
didTransition() {
|
|
|
|
const editController = this.controllerFor(
|
|
|
|
"adminCustomizeEmailTemplates.edit"
|
|
|
|
);
|
|
|
|
|
|
|
|
if (!editController.emailTemplate) {
|
|
|
|
this.transitionTo(
|
|
|
|
"adminCustomizeEmailTemplates.edit",
|
|
|
|
this.controller.get("sortedTemplates.firstObject")
|
|
|
|
);
|
|
|
|
}
|
2015-11-13 05:08:19 +08:00
|
|
|
}
|
|
|
|
});
|