web/firebase/index.js
/**
 * Creates a Firebase database document with a field containing the Firebase
 * storage download URL for an image added by the user.
 * @param {string} src - Firebase Storage download URL for an image
 */
Creates a Firebase database document with a field containing the Firebase
storage download URL for an image added by the user.
@param {string} src - Firebase Storage download URL for an image
Creates a Firebase database document with a field containing the Firebase storage download URL for an image added by the user . @param { string } src - Firebase Storage download URL for an image
function attachImageToUser(src) {
  db.collection("users").doc(currentUser.email).collection("images").add({
    image: src
  }).then(function () {
    console.log("Document written with user ID: ", currentUser.email);
  }).catch(function (error) {
    console.error("Error adding document: ", error);
  });
}
function attachImageToUser ( src ) { db . collection ( "users" ) . doc ( currentUser . email ) . collection ( "images" ) . add ( { image : src } ) . then ( function ( ) { console . log ( "Document written with user ID: " , currentUser . email ) ; } ) . catch ( function ( error ) { console . error ( "Error adding document: " , error ) ; } ) ; }
Creates a Firebase database document with a field containing the Firebase
 storage download URL for an image added by the user.
Creates a Firebase database document with a field containing the Firebase storage download URL for an image added by the user .