mirror of
https://github.com/crater-invoice/crater.git
synced 2025-12-16 18:32:55 -05:00
refactor initial data loading in dashboard
This commit is contained in:
@@ -9,10 +9,11 @@ export default {
|
||||
bootstrap ({ commit, dispatch, state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
window.axios.get('/api/bootstrap').then((response) => {
|
||||
commit('company/' + companyTypes.BOOTSTRAP_COMPANIES, response.data.companies)
|
||||
commit('company/' + companyTypes.SET_SELECTED_COMPANY, response.data.company)
|
||||
commit('currency/' + currencyTypes.BOOTSTRAP_CURRENCIES, response.data)
|
||||
commit('currency/' + currencyTypes.SET_DEFAULT_CURRENCY, response.data)
|
||||
commit('user/' + userTypes.BOOTSTRAP_CURRENT_USER, response.data.user)
|
||||
commit('company/' + companyTypes.BOOTSTRAP_COMPANIES, response.data.companies)
|
||||
commit('taxType/' + taxTypeTypes.BOOTSTRAP_TAX_TYPES, response.data.taxTypes)
|
||||
commit('preferences/' + preferencesTypes.SET_MOMENT_DATE_FORMAT, response.data.moment_date_format)
|
||||
commit('preferences/' + preferencesTypes.SET_LANGUAGE_FORMAT, response.data.default_language)
|
||||
|
||||
Reference in New Issue
Block a user