From 30f9f59923b6e537e6a5ba0ad05c1b9b4b8a4252 Mon Sep 17 00:00:00 2001 From: Adolfo Reyna Date: Mon, 18 Oct 2021 21:44:21 -0700 Subject: [PATCH] fix following to be string id" --- dbTools/post.js | 4 ++-- dbTools/profile.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dbTools/post.js b/dbTools/post.js index d6cf297..7d82ceb 100644 --- a/dbTools/post.js +++ b/dbTools/post.js @@ -134,10 +134,10 @@ postDB = (DB)=>{ filteredPosts.push(p); continue; } - if(isPostingAPrivateGroup && !following[p.profileid + ""]){ + if(isPostingAPrivateGroup && !following[p.profileid]){ continue; } - if(isPostingToAPrivateGroup && !following[p.toProfile + ""]){ + if(isPostingToAPrivateGroup && !following[p.toProfile]){ continue; } filteredPosts.push(p); diff --git a/dbTools/profile.js b/dbTools/profile.js index 64e7a6c..9d186c4 100644 --- a/dbTools/profile.js +++ b/dbTools/profile.js @@ -90,7 +90,7 @@ userDB = (DB) => { const _id = DB.ObjectID(profileId); let update = { $addToSet:{ - following: followProfileId + following: followProfileId + '' //converts to str } } return DB.profileCols.updateOne({_id}, update).catch((err)=>{ @@ -103,7 +103,7 @@ userDB = (DB) => { const _id = DB.ObjectID(profileId); let update = { $pull:{ - following: followProfileId + following: followProfileId + '' //converts to str } } return DB.profileCols.updateOne({_id}, update).catch((err)=>{