Update
This commit is contained in:
parent
c7b9e41fd0
commit
2d49ee2a64
@ -42,9 +42,7 @@ function productSubmutEventHandler(){
|
|||||||
var storageRef = firebase.storage().ref('/product-img/' + imgPath)
|
var storageRef = firebase.storage().ref('/product-img/' + imgPath)
|
||||||
updateDBImg(productKey, imgPath)
|
updateDBImg(productKey, imgPath)
|
||||||
|
|
||||||
storageRef.put(image).then(function(){
|
storageRef.put(image)
|
||||||
window.location.replace('home?itemAdded=true')
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addItem(item){
|
function addItem(item){
|
||||||
@ -60,7 +58,9 @@ function updateDBImg(key, value){
|
|||||||
var itemRef = database.ref('/products/' + key)
|
var itemRef = database.ref('/products/' + key)
|
||||||
console.log("itemRef")
|
console.log("itemRef")
|
||||||
console.log(itemRef)
|
console.log(itemRef)
|
||||||
itemRef.update({img: value});
|
itemRef.update({img: value}).then(function(){
|
||||||
|
window.location.replace('home?itemAdded=true')
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateImgs() {
|
function updateImgs() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user