Created
September 12, 2015 16:21
-
-
Save kwhitaker/658681445e762699c698 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
export function createCharacter(char) { | |
return dispatch => { | |
dispatch(submitCharacter(char)); | |
return request.post('/new-character') | |
.send(JSON.stringify(char)) | |
.then((response) => { | |
dispatch(routeToNewCharacter(response.body.id)); | |
}, (error) => { | |
dispatch(receiveCharError(error.message)); | |
}); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment