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