|
|
|
@ -15,24 +15,17 @@ async function uploadImage (encodedImage) {
|
|
|
|
|
|
|
|
|
|
const data = new FormData()
|
|
|
|
|
data.append('image', encodedImage)
|
|
|
|
|
data.append('type', 'base64')
|
|
|
|
|
data.append('type', 'image/png')
|
|
|
|
|
|
|
|
|
|
const config = {
|
|
|
|
|
headers: {
|
|
|
|
|
Authorization: ` Client-ID 87cc98dcdabcbb3`
|
|
|
|
|
Authorization: `Client-ID 87cc98dcdabcbb3`
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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) => {
|
|
|
|
|