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

21 lines
391 B
Plaintext
Raw Normal View History

import { ajax } from "discourse/lib/ajax";
2019-09-12 01:13:08 -04:00
export default Discourse.Route.extend({
model() {
const user = Ember.Object.create({
2019-09-12 01:13:08 -04:00
name: "",
email: "",
phone: ""
});
return ajax("/patrons/patrons", {
method: "get"
}).then((result) => {
2019-09-12 23:02:28 -04:00
user.set('email', result.email);
return user;
}).catch(() => {
return user;
});
2019-09-12 01:13:08 -04:00
}
});