This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
site-base/spark/resources/assets/js/settings/teams/update-team-name.js
2017-11-03 16:26:07 +11:00

37 lines
674 B
JavaScript
Vendored

module.exports = {
props: ['user', 'team'],
/**
* The component's data.
*/
data() {
return {
form: new SparkForm({
name: ''
})
};
},
/**
* Prepare the component.
*/
mounted() {
this.form.name = this.team.name;
},
methods: {
/**
* Update the team name.
*/
update() {
Spark.put(`/settings/${Spark.pluralTeamString}/${this.team.id}/name`, this.form)
.then(() => {
Bus.$emit('updateTeam');
Bus.$emit('updateTeams');
});
}
}
};