Skip to content

Instantly share code, notes, and snippets.

@Njuelle
Created February 10, 2019 15:54
Show Gist options
  • Select an option

  • Save Njuelle/296b6cc9001332f094921dc5a5ede354 to your computer and use it in GitHub Desktop.

Select an option

Save Njuelle/296b6cc9001332f094921dc5a5ede354 to your computer and use it in GitHub Desktop.
actions: {
createUser ({commit}, user) {
commit('CREATING_USER');
axios.post(
'/api/user/create',
{ user: user }
)
.then(response => {
commit('CREATING_USER_SUCCESS', response.data);
})
.catch(error => {
commit('CREATING_USER_ERROR', error.message);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment