Created
April 1, 2021 03:04
-
-
Save m3l1nd4/d91d568465a6f7ba97b1b19f40f3d81a 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
// Add new items to the Shop List | |
function addNewShopToFirebase(jsonObject) { | |
db.collection('shops').add({ | |
'name': jsonObject.name, | |
'telephone': jsonObject.telephone, | |
'address': jsonObject.address, | |
'location': jsonObject.location | |
}); | |
} | |
// Add new items to the Product List | |
function addNewProductToFirebase(jsonObject, imgSrc) { | |
db.collection('products').add({ | |
'code': jsonObject.code, | |
'name': jsonObject.name, | |
'price': jsonObject.price, | |
'quantity': jsonObject.quantity, | |
'shop': jsonObject.shop, | |
'image': imgSrc | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment