|
|
|
@ -15,7 +15,7 @@ async function uploadImage (encodedImage) {
|
|
|
|
|
|
|
|
|
|
const data = new FormData()
|
|
|
|
|
data.append('image', encodedImage)
|
|
|
|
|
data.append('type', 'base64')
|
|
|
|
|
data.append('type', 'image/png')
|
|
|
|
|
|
|
|
|
|
const config = {
|
|
|
|
|
headers: {
|
|
|
|
@ -23,16 +23,9 @@ async function uploadImage (encodedImage) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const result = await axios.post(url, data, config)
|
|
|
|
|
|
|
|
|
|
console.log('success! ')
|
|
|
|
|
console.log(Object.keys(result.data))
|
|
|
|
|
console.log(result.data)
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.log('bummer man')
|
|
|
|
|
console.log(e)
|
|
|
|
|
}
|
|
|
|
|
return axios.post(url, data, config)
|
|
|
|
|
.then(res => res.data)
|
|
|
|
|
.catch(console.log)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getGist = (id) => {
|
|
|
|
|