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/invoices/update-extra-billing-information.js
2017-11-03 16:26:07 +11:00

46 lines
936 B
JavaScript
Vendored

module.exports = {
props: ['user', 'team', 'billableType'],
/**
* The component's data.
*/
data() {
return {
form: new SparkForm({
information: ''
})
};
},
/**
* Prepare the component.
*/
mounted() {
this.form.information = this.billable.extra_billing_information;
},
methods: {
/**
* Update the extra billing information.
*/
update() {
Spark.put(this.urlForUpdate, this.form);
}
},
computed: {
/**
* Get the URL for the extra billing information method update.
*/
urlForUpdate() {
return this.billingUser
? '/settings/extra-billing-information'
: `/settings/${Spark.pluralTeamString}/${this.team.id}/extra-billing-information`;
}
}
};