basj i buksa, biblioteket e oppegående

This commit is contained in:
sava
2020-03-26 02:30:12 +01:00
parent 5ca75569ad
commit f7970ddb6b
7 changed files with 112 additions and 24 deletions

View File

@@ -1,4 +1,15 @@
db = init().firestore()
bibliotekcoll = db.collection("bibliotek")
var add = function() {
db.collection("bibliotek").add({
tittel: $('#title')[0].value,
forfatter: $('#author')[0].value,
forlag: $('#publisher')[0].value,
terningkast: $('#rating')[0].value,
utgitt: $('#published')[0].value
}).then(function() {
$('#status').html('<p style="color: green;">La til bok '+$('#title').value+'!</p>')
}).catch(function() {
$('#status').html('<p style="color: red;">Problem med å legge til bok '+$('#title').value+'!</p>')
})
}