Home > Blockchain >  Vue.js vuex unknown action type
Vue.js vuex unknown action type

Time:11-24

I'm really scratching my head on this one - anybody got any ideas? In my App.vue, I've got these 2 calls:

bus.$on('loadTeams', (data) => {
  this.$store.dispatch('updateTeams', data)
})
bus.$on('loadDepartments', (data) => {
  this.$store.dispatch('updateDepartments', data)
})

They both get called correctly (I've confirmed that...). Now, in my vuex store.js, I have this:

 mutations: {
   ....
   updateDepartments: (state, payload) => {
     state.departments = payload
   },
   updateTeams: (state, payload) => {
     state.teams = payload
   },
   ...
 }

updateTeams works fine, but updateDepartments errors with:

[vuex] unknown action type: updateDepartments

...but I just can't see why. Any ideas?

  • Related