discourse/app/assets/javascripts/admin/routes/admin-customize-email-templ...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
590 B
JavaScript
Raw Normal View History

import Route from "@ember/routing/route";
import { action } from "@ember/object";
export default Route.extend({
model() {
return this.store.findAll("email-template");
},
setupController(controller, model) {
controller.set("emailTemplates", model);
},
@action
didTransition() {
const editController = this.controllerFor(
"adminCustomizeEmailTemplates.edit"
);
if (!editController.emailTemplate) {
this.transitionTo(
"adminCustomizeEmailTemplates.edit",
this.controller.get("sortedTemplates.firstObject")
);
}
}
});