import axios from 'axios' export default { namespaced: true, state: { configs: [], entries: [], dialog: { show: false, type: null, info: {} } }, mutations: { setConfigs (state, configs) { state.configs = configs }, setEntries (state, entries) { state.entries = entries }, setDialog (state, { show, type, info }) { if (info !== undefined) state.dialog.info = info if (type !== undefined) state.dialog.type = type if (show !== undefined) state.dialog.show = show } }, actions: { loadData (context) { axios.get('/api/configurator/configs').then(result => { context.commit('setConfigs', result.data) }) axios.get('/api/configurator/entries').then(result => { context.commit('setEntries', result.data) }) } } }