add private groups
This commit is contained in:
@@ -127,12 +127,15 @@ postDB = (DB)=>{
|
||||
{profileid: {
|
||||
$in: ids
|
||||
}},
|
||||
{toProfile: {
|
||||
$in: ids
|
||||
}}
|
||||
//{toProfile: {
|
||||
// $in: ids
|
||||
//}}
|
||||
]
|
||||
};
|
||||
return DB.postCols.find(query).sort({lastUpdated: -1}).limit(20).toArray().catch((err)=>{
|
||||
return DB.postCols.find(query).sort({lastUpdated: -1}).limit(20).toArray().then(async (posts)=>{
|
||||
//we need to filter when toProfile is private and not part of the following array
|
||||
return posts;
|
||||
}).catch((err)=>{
|
||||
console.log(err);
|
||||
return false;
|
||||
});
|
||||
@@ -140,7 +143,7 @@ postDB = (DB)=>{
|
||||
|
||||
DB.getPostsOfUser = (userId) => {
|
||||
let userid = DB.ObjectID(userId);
|
||||
return DB.postCols.find({userid}).sort({_id: -1}).toArray().catch((err)=>{
|
||||
return DB.postCols.find({userid}).sort({_id: -1}).limit(20).toArray().catch((err)=>{
|
||||
console.log(err);
|
||||
return false;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user