forked from goops17/RideSharingWebApp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctionality.js
More file actions
54 lines (47 loc) · 1.65 KB
/
functionality.js
File metadata and controls
54 lines (47 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
var config = {
apiKey: "AIzaSyCzdmFfujk0A1UegxmmE5vVPR3il7UEEeg",
authDomain: "ride-sharing-web-app.firebaseapp.com",
databaseURL: "https://ride-sharing-web-app.firebaseio.com",
storageBucket: "ride-sharing-web-app.appspot.com",
};
firebase.initializeApp(config);
// Get a reference to the database service
var firestore = firebase.firestore();
var docRef1 = firestore.Collection("Users").doc("1234567789");
docRef1.get().then(function(doc) {
if(doc.exists) {
console.log("document data:", doc.data());
} else {
console.log("No such documentation or an error in coding occured.");
console.log("see functionallity.js around line 16 for error in code.");
}
}).catch(function(error) {
console.log("Error getting document:", error);
});
/* new style of sheet from youtube this gets data from the firebase
function renderCafe(doc) {
let li = document.createElement('li');
let name = document.createElement('span');
let city = document.createElement('span');
li.setAttribute('data-id', doc.id);
name.textContent = doc.data().any;
city.textContent = doc.data().any;
li.appendChild(name);
li.appendChild(city);
cafeList.appendChild(li);
}
db.collect('Users').get().then((snapshot) => {
snapshot.docs.forEach(doc => {
renderCafe(doc);
})
})
*/
/* function writeUserData(ID, email, first_name, last_name, middle_name, User_password) {
firebase.database().ref('users/' + userId).set({
studentID: ID,
fName: first_name,
lName: last_name,
mName: middle_name,
password: User_password
});
} */