[Vuejs]-Vue.js โ€“ Vuexx : state value undefined

0๐Ÿ‘

I solved the issue , modifying the action populateShoppingLists
Need to pass the state as a parameter with the commit , so I can use the getters inside my action

populateShoppingLists: ({ commit, state }) => {
    let currentUserId = getters.currentUserId(state)
    console.log('currentUserId: ', currentUserId). // => userId: 1 Ok
    return api.fetchShoppingLists(currentUserId)

Leave a comment