I have one modal for create user. There I need to call API and I am calling it through vuex store method i.e mapGetters. However it's not working. Can anyone tell me whats missing here?
create-user file.
import {mapGetters} from "vuex"
computed: {
...mapGetters("Entities", ["getEntities"]),
}
entities file:
const state = () => ({
entities: []
})
const getters = {
getEntities: (state) => state.entities
}
const mutations = {
setEntities(state, entities) {
state.entities = [...entities]
}
}
const actions = {
async fetchEntities({commit}) {
return await axios.get('/entity')
.then((resp) => {
return resp
})
}
}