function addNotificationToDB(buyerUserData, giftDeleter, giftTitle){
    var pageName = "deleteGiftPrivate";
    var giftOwner = user.uid;
    var notificationString = generateNotificationString(giftOwner, giftDeleter, giftTitle, pageName);
    var buyerUserNotifications;
    if(buyerUserData.notifications == undefined || buyerUserData.notifications == null){
      buyerUserNotifications = [];
    } else {
      buyerUserNotifications = buyerUserData.notifications;
    }
    buyerUserNotifications.push(notificationString);

    if(buyerUserData.notifications != undefined) {
      firebase.database().ref("users/" + buyerUserData.uid).update({
        notifications: buyerUserNotifications
      });
    } else {
      console.log("New Notifications List");
      firebase.database().ref("users/" + buyerUserData.uid).update({notifications:{0:notificationString}});
    }
    console.log("Added Notification To DB");
  }
//This function adds a notification to the database
This function adds a notification to the database
This function adds a notification to the database
function addNotificationToDB(buyerUserData, giftDeleter, giftTitle){
    var pageName = "deleteGiftPrivate";
    var giftOwner = user.uid;
    var notificationString = generateNotificationString(giftOwner, giftDeleter, giftTitle, pageName);
    var buyerUserNotifications;
    if(buyerUserData.notifications == undefined || buyerUserData.notifications == null){
      buyerUserNotifications = [];
    } else {
      buyerUserNotifications = buyerUserData.notifications;
    }
    buyerUserNotifications.push(notificationString);
    if(buyerUserData.notifications != undefined) {
      firebase.database().ref("users/" + buyerUserData.uid).update({
        notifications: buyerUserNotifications
      });
    } else {
      console.log("New Notifications List");
      firebase.database().ref("users/" + buyerUserData.uid).update({notifications:{0:notificationString}});
    }
    console.log("Added Notification To DB");
  }
function addNotificationToDB ( buyerUserData , giftDeleter , giftTitle ) { var pageName = "deleteGiftPrivate" ; var giftOwner = user . uid ; var notificationString = generateNotificationString ( giftOwner , giftDeleter , giftTitle , pageName ) ; var buyerUserNotifications ; if ( buyerUserData . notifications == undefined || buyerUserData . notifications == null ) { buyerUserNotifications = [ ] ; } else { buyerUserNotifications = buyerUserData . notifications ; } buyerUserNotifications . push ( notificationString ) ; if ( buyerUserData . notifications != undefined ) { firebase . database ( ) . ref ( "users/" + buyerUserData . uid ) . update ( { notifications : buyerUserNotifications } ) ; } else { console . log ( "New Notifications List" ) ; firebase . database ( ) . ref ( "users/" + buyerUserData . uid ) . update ( { notifications : { 0 : notificationString } } ) ; } console . log ( "Added Notification To DB" ) ; }
This function adds a notification to the database
This function adds a notification to the database