Created
May 10, 2019 12:26
-
-
Save ntakouris/e0242c021c02f3ba5ed85fa174e63367 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios' | |
import ApiRoutes from '@/api/ApiRoutes' | |
const state = { | |
nodeList: [], | |
} | |
const getters = {} | |
const actions = { | |
async getNodeList ({ commit }) { | |
const response = await axios.get(ApiRoutes.Nodes.GetAll) | |
const nodes = response.data | |
commit('setNodeList', nodes) | |
}, | |
} | |
const mutations = { | |
setNodeList (state, nodeList) { | |
state.nodeList = nodeList | |
}, | |
} | |
export default { | |
namespaced: true, | |
state, | |
getters, | |
actions, | |
mutations | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment