import {getConfig} from '@/api/tenant/config'

export default {
  state: {trial: 0},
  actions: {
    GetConfig({commit}) {
      return new Promise(function(resolve, reject) {
        getConfig()
        .then((resp) => {                
          resolve()
          commit('SET_TRIAL', resp.data.data.trialOn)
        })
        .catch(reject)
      })
    }
  },
  mutations: {
    RESET_CONFIG(state) {
      state.trial = 0
    },
    SET_TRIAL(state, trial) {
      state.trial = trial
    }
  }
}