yt-devmeetup-vue-firebase
yt-devmeetup-vue-firebase copied to clipboard
Firebase `downloadURLs` is deprecated
https://github.com/academind/yt-devmeetup-vue-firebase/blob/0f3ee16c83b2c4a23ef497a1ad0656cd0f92f921/src/store/index.js#L99
REFERENCE: https://firebase.google.com/docs/reference/js/firebase.storage.Reference#getDownloadURL
FIX:
imageUrl = fileData.ref.getDownloadURL().then((firebaseUrl) => {
return firebase.database().ref('meetups').child(key).update({imageUrl: firebaseUrl})
})
I Need its latest version
Errors upon "npm run dev"
Not admitting that I have the best solution, but the code below worked for me after a few hours of trying
code:
const filename = payload.image.name
const ext = filename.slice(filename.lastIndexOf('.'))
firebase.storage().ref('equipment/' + key + ext).put(payload.image)
.then(() => {
return firebase.storage().ref('equipment/' + key + ext).getDownloadURL()
.then((url) => {
firebase.database().ref('equipment').child(key).update({ imageUrl: url })
})
})
})`
ignore the equipment ref if you are following max's example, I customised it for myself and you can change it back to meetup