Skip to content

Instantly share code, notes, and snippets.

@m3l1nd4
Created April 1, 2021 03:04
Show Gist options
  • Save m3l1nd4/d91d568465a6f7ba97b1b19f40f3d81a to your computer and use it in GitHub Desktop.
Save m3l1nd4/d91d568465a6f7ba97b1b19f40f3d81a to your computer and use it in GitHub Desktop.
// 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