mirror of
https://github.com/discourse/discourse.git
synced 2024-12-14 11:43:40 +08:00
c190994046
This commit was generated using the ember-native-class-codemod along with a handful of manual updates
29 lines
850 B
JavaScript
29 lines
850 B
JavaScript
import Controller from "@ember/controller";
|
|
import IncomingEmail from "admin/models/incoming-email";
|
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
|
import { longDate } from "discourse/lib/formatter";
|
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
|
|
|
export default class AdminIncomingEmailController extends Controller.extend(
|
|
ModalFunctionality
|
|
) {
|
|
@discourseComputed("model.date")
|
|
date(d) {
|
|
return longDate(d);
|
|
}
|
|
|
|
load(id) {
|
|
return IncomingEmail.find(id).then((result) => this.set("model", result));
|
|
}
|
|
|
|
loadFromBounced(id) {
|
|
return IncomingEmail.findByBounced(id)
|
|
.then((result) => this.set("model", result))
|
|
.catch((error) => {
|
|
this.send("closeModal");
|
|
popupAjaxError(error);
|
|
});
|
|
}
|
|
}
|