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
|
|
|
|
2019-12-02 18:29:44 -05:00
|
|
|
return ajax("/s", {
|
2019-09-12 22:56:26 -04:00
|
|
|
method: "get"
|
2019-09-12 23:46:32 -04:00
|
|
|
})
|
|
|
|
.then(result => {
|
|
|
|
user.set("email", result.email);
|
|
|
|
return user;
|
|
|
|
})
|
|
|
|
.catch(() => {
|
|
|
|
return user;
|
|
|
|
});
|
2019-09-12 01:13:08 -04:00
|
|
|
}
|
|
|
|
});
|