discourse-subscriptions/assets/javascripts/discourse/routes/s.js.es6

23 lines
399 B
JavaScript

import { ajax } from "discourse/lib/ajax";
export default Discourse.Route.extend({
model() {
const user = Ember.Object.create({
name: "",
email: "",
phone: ""
});
return ajax("/s", {
method: "get"
})
.then(result => {
user.set("email", result.email);
return user;
})
.catch(() => {
return user;
});
}
});