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