Last active
June 13, 2021 19:14
-
-
Save hpierre74/e3a4e4ef5c569ea56b2740310c9c88c4 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
import { addUserProfile } from '@lib/user.actions'; | |
export const createProfile = ({ profileName, profileId, avatarUrl }) => async (dispatch, getState) => { | |
await fetch('/api/profile', { method: 'POST', body: JSON.stringify({ profileId, profileName, avatarUrl }) }); | |
dispatch(addUserProfile(profileId)); | |
return dispatch({ type: 'CREATE_PROFILE', payload: { profileId, profileName, avatarUrl }); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment