discourse/app/assets/javascripts/admin/addon/routes/admin-customize-email-templates.js
David Taylor 48193767bf DEV: Sort imports
Automatically generated by `eslint --fix` to satisfy the updated configuration
2023-10-10 21:46:54 +01:00

30 lines
706 B
JavaScript

import { action } from "@ember/object";
import Route from "@ember/routing/route";
import { inject as service } from "@ember/service";
export default class AdminCustomizeEmailTemplatesRoute extends Route {
@service router;
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.router.transitionTo(
"adminCustomizeEmailTemplates.edit",
this.controller.get("sortedTemplates.firstObject")
);
}
}
}