export const mutations = {
  setItems(state, {resource, items}) {
    console.log('store/index.js mutations > setItems')
    state[resource].items = items
  }
}

export const actions = {
  async nuxtServerInit({commit, dispatch}) {
    console.log('index.js actions call await dispatch(auth/getAuthUser)')
    await dispatch('auth/getAuthUser').catch(() => console.log('Not Authenticated!'))
    console.log('index.js actions done await dispatch(auth/getAuthUser)')
    console.log('index.js actions call await dispatch(hero/fetchHero)')
    await dispatch('hero/fetchHero').catch(() => console.log('Cannot fetch page data'))
    console.log('index.js actions done await dispatch(hero/fetchHero)')
  }
}