discourse/app/assets/javascripts/admin/controllers/modals/admin-incoming-email.js

Failed to ignore revisions in .git-blame-ignore-revs.

27 lines
801 B
JavaScript
Raw Normal View History

import discourseComputed from "discourse-common/utils/decorators";
import Controller from "@ember/controller";
2018-06-15 23:03:24 +08:00
import ModalFunctionality from "discourse/mixins/modal-functionality";
import IncomingEmail from "admin/models/incoming-email";
import { longDate } from "discourse/lib/formatter";
import { popupAjaxError } from "discourse/lib/ajax-error";
export default 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)
2018-06-15 23:03:24 +08:00
.then(result => this.set("model", result))
.catch(error => {
this.send("closeModal");
popupAjaxError(error);
});
}
});