Created
July 8, 2019 17:34
-
-
Save gufranmirza/5d82572098b68b15929af0a37b820a5a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// store/index.js | |
actions: { | |
nuxtServerInit ({ commit}, { req }) { | |
if (req.session.user) { | |
commit('setUser', req.session.user); | |
return axios.get(`/users/${req.session.user}`).then((response) =>{ | |
commit('currentUserData', response.data); | |
}) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment