osb/spark/resources/assets/js/settings/subscription.js
2017-11-03 16:26:07 +11:00

51 lines
1002 B
JavaScript
Vendored

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"});
});
}
}
};