Set the user email initially in stripe form

This commit is contained in:
Rimian Perkins 2019-09-13 12:56:26 +10:00
parent 2a1d4702fa
commit 63ea563553
1 changed files with 12 additions and 1 deletions

View File

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