Set the user email initially in stripe form
This commit is contained in:
parent
2a1d4702fa
commit
63ea563553
|
@ -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;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue