index.js 471 B

1234567891011121314
  1. export const mutations = {
  2. setItems(state, {resource, items}) {
  3. console.log('store/index.js mutations > setItems')
  4. state[resource].items = items
  5. }
  6. }
  7. export const actions = {
  8. async nuxtServerInit({commit, dispatch}) {
  9. console.log('index.js actions call await dispatch(auth/getAuthUser)')
  10. await dispatch('auth/getAuthUser').catch(() => console.log('Not Authenticated!'))
  11. console.log('index.js actions done await dispatch(auth/getAuthUser)')
  12. }
  13. }