Chore: Remove dead code related to billing (#935)
- remove subscription model - remove billing-related code
This commit is contained in:
@@ -4,7 +4,6 @@ import Vuex from 'vuex';
|
||||
import accounts from './modules/accounts';
|
||||
import agents from './modules/agents';
|
||||
import auth from './modules/auth';
|
||||
import billing from './modules/billing';
|
||||
import cannedResponse from './modules/cannedResponse';
|
||||
import Channel from './modules/channels';
|
||||
import contactConversations from './modules/contactConversations';
|
||||
@@ -27,7 +26,6 @@ export default new Vuex.Store({
|
||||
accounts,
|
||||
agents,
|
||||
auth,
|
||||
billing,
|
||||
cannedResponse,
|
||||
Channel,
|
||||
contactConversations,
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
/* eslint no-console: 0 */
|
||||
/* eslint no-param-reassign: 0 */
|
||||
/* eslint no-shadow: 0 */
|
||||
import * as types from '../mutation-types';
|
||||
import Billing from '../../api/billing';
|
||||
|
||||
const state = {
|
||||
fetchingStatus: false,
|
||||
billingDetails: {},
|
||||
status: null,
|
||||
};
|
||||
|
||||
const getters = {
|
||||
getBillingDetails(_state) {
|
||||
return _state.billingDetails;
|
||||
},
|
||||
billingFetchStatus(_state) {
|
||||
return _state.fetchingStatus;
|
||||
},
|
||||
};
|
||||
|
||||
const actions = {
|
||||
fetchSubscription({ commit }) {
|
||||
commit(types.default.TOGGLE_SUBSCRIPTION_LOADING, true);
|
||||
Billing.getSubscription()
|
||||
.then(billingDetails => {
|
||||
commit(types.default.SET_SUBSCRIPTION, billingDetails.data);
|
||||
commit(
|
||||
types.default.TOGGLE_SUBSCRIPTION_LOADING,
|
||||
false,
|
||||
billingDetails.status
|
||||
);
|
||||
})
|
||||
.catch(error => {
|
||||
const { response } = error;
|
||||
commit(
|
||||
types.default.TOGGLE_SUBSCRIPTION_LOADING,
|
||||
false,
|
||||
response.status
|
||||
);
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
const mutations = {
|
||||
[types.default.SET_SUBSCRIPTION](_state, billingDetails) {
|
||||
_state.billingDetails = billingDetails;
|
||||
},
|
||||
[types.default.TOGGLE_SUBSCRIPTION_LOADING](_state, flag, apiStatus) {
|
||||
_state.fetchingStatus = flag;
|
||||
_state.status = apiStatus;
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
state,
|
||||
getters,
|
||||
actions,
|
||||
mutations,
|
||||
};
|
||||
@@ -93,10 +93,6 @@ export default {
|
||||
SET_ACCOUNT_SUMMARY: 'SET_ACCOUNT_SUMMARY',
|
||||
TOGGLE_ACCOUNT_REPORT_LOADING: 'TOGGLE_ACCOUNT_REPORT_LOADING',
|
||||
|
||||
// Billings
|
||||
SET_SUBSCRIPTION: 'SET_SUBSCRIPTION',
|
||||
TOGGLE_SUBSCRIPTION_LOADING: 'TOGGLE_SUBSCRIPTION_LOADING',
|
||||
|
||||
// Conversation Metadata
|
||||
SET_CONVERSATION_METADATA: 'SET_CONVERSATION_METADATA',
|
||||
|
||||
|
||||
Reference in New Issue
Block a user