Created
September 13, 2016 08:28
-
-
Save jnsdls/1aea5efe12b623899bfe341d246e82a7 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
handleTakePhoto() { | |
this.props.bebo.Camera.capturePhoto((image_uri) => { | |
// I'm doing a bunch of image manipulation here before sending the resulting base64 to savePhoto() | |
}) | |
} | |
savePhoto(base64) { | |
const { actingUser, saving } = this.state; | |
if(!actingUser){ return console.error('need acting user to save image')} | |
if(!base64){ return console.error('need savable base64 to save image, but got', base64)} | |
// the bebo.uploadImage function takes base64 and returns an absolute URL | |
this.props.bebo.uploadImage(base64).then((upload_resp) => { | |
// building our photo object | |
const photo = { | |
user: actingUser, | |
image_url: upload_resp | |
}; | |
this.Db.Photos.POST(photo).then((save_resp) => { | |
// we're handling the response of saving the image here | |
}) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment