Skip to content

Instantly share code, notes, and snippets.

@pashagray
Created October 19, 2017 08:06
Show Gist options
  • Save pashagray/50b481407afc6effb58b9813fbd2daf0 to your computer and use it in GitHub Desktop.
Save pashagray/50b481407afc6effb58b9813fbd2daf0 to your computer and use it in GitHub Desktop.
export const usersCreate = data => (dispatch) => {
dispatch(usersCreateStart());
postUser(data)
.then(
(res) => {
dispatch(usersCreateSuccess());
dispatch(push(`/admin/users/${res.user.id}`));
dispatch(showSuccess('user_create'));
},
(err) => {
dispatch(usersCreateFailure(err));
dispatch(showError('user_create'));
},
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment