init crater

This commit is contained in:
Mohit Panjwani
2019-11-11 12:16:00 +05:30
commit bdf2ba51d6
668 changed files with 158503 additions and 0 deletions

View File

@ -0,0 +1,7 @@
import * as types from './mutation-types'
import Ls from '@/services/ls'
export const setSelectedCompany = ({ commit, dispatch, state }, data) => {
Ls.set('selectedCompany', data.id)
commit(types.SET_SELECTED_COMPANY, data)
}

View File

@ -0,0 +1,2 @@
export const getSelectedCompany = (state) => state.selectedCompany
export const getCompanies = (state) => state.companies

View File

@ -0,0 +1,20 @@
import mutations from './mutations'
import * as actions from './actions'
import * as getters from './getters'
const initialState = {
selectedCompany: null,
companies: []
}
export default {
namespaced: true,
state: initialState,
getters: getters,
actions: actions,
mutations: mutations
}

View File

@ -0,0 +1,2 @@
export const BOOTSTRAP_COMPANIES = 'BOOTSTRAP_COMPANIES'
export const SET_SELECTED_COMPANY = 'SET_SELECTED_COMPANY'

View File

@ -0,0 +1,11 @@
import * as types from './mutation-types'
export default {
[types.BOOTSTRAP_COMPANIES] (state, companies) {
state.companies = companies
state.selectedCompany = companies[0]
},
[types.SET_SELECTED_COMPANY] (state, company) {
state.selectedCompany = company
}
}