mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-29 12:41:10 -04:00
refactor initial data loading in dashboard
This commit is contained in:
@ -1,7 +1,5 @@
|
||||
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)
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import * as types from './mutation-types'
|
||||
import Ls from '@/services/ls'
|
||||
|
||||
export default {
|
||||
[types.BOOTSTRAP_COMPANIES] (state, companies) {
|
||||
@ -6,6 +7,7 @@ export default {
|
||||
state.selectedCompany = companies[0]
|
||||
},
|
||||
[types.SET_SELECTED_COMPANY] (state, company) {
|
||||
Ls.set('selectedCompany', company.id)
|
||||
state.selectedCompany = company
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user