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/subscription.js

51 lines
1002 B
JavaScript
Raw Normal View History

2017-11-03 05:26:07 +00:00
module.exports = {
props: ['user', 'team', 'billableType'],
/**
* Load mixins for the component.
*/
mixins: [
require('./../mixins/plans'),
require('./../mixins/subscriptions')
],
/**
* The component's data.
*/
data() {
return {
plans: []
};
},
/**
* Prepare the component.
*/
mounted() {
var self = this;
this.getPlans();
this.$on('showPlanDetails', function (plan) {
self.showPlanDetails(plan);
});
},
methods: {
/**
* Get the active plans for the application.
*/
getPlans() {
axios.get('/spark/plans')
.then(response => {
this.plans = this.billingUser
? _.where(response.data, {type: "user"})
: _.where(response.data, {type: "team"});
});
}
}
};