osb/spark/resources/assets/js/settings/profile/update-contact-information.js

38 lines
724 B
JavaScript
Raw Normal View History

2017-11-03 05:26:07 +00:00
module.exports = {
props: ['user'],
/**
* The component's data.
*/
data() {
return {
form: $.extend(true, new SparkForm({
name: '',
email: ''
}), Spark.forms.updateContactInformation)
};
},
/**
* Bootstrap the component.
*/
mounted() {
this.form.name = this.user.name;
this.form.email = this.user.email;
},
methods: {
/**
* Update the user's contact information.
*/
update() {
Spark.put('/settings/contact', this.form)
.then(() => {
Bus.$emit('updateUser');
});
}
}
};