mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 04:52:52 +08:00
30 lines
653 B
Plaintext
30 lines
653 B
Plaintext
|
import { ajax } from "discourse/lib/ajax";
|
||
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||
|
|
||
|
export default Ember.Controller.extend({
|
||
|
email: null,
|
||
|
text: null,
|
||
|
elided: null,
|
||
|
format: null,
|
||
|
|
||
|
actions: {
|
||
|
run() {
|
||
|
this.set("loading", true);
|
||
|
|
||
|
ajax("/admin/email/advanced-test", {
|
||
|
type: "POST",
|
||
|
data: { email: this.get("email") }
|
||
|
})
|
||
|
.then(data => {
|
||
|
this.setProperties({
|
||
|
text: data.text,
|
||
|
elided: data.elided,
|
||
|
format: data.format
|
||
|
});
|
||
|
})
|
||
|
.catch(popupAjaxError)
|
||
|
.finally(() => this.set("loading", false));
|
||
|
}
|
||
|
}
|
||
|
});
|