news posts
This commit is contained in:
@@ -166,7 +166,8 @@ postDB = (DB)=>{
|
||||
{toProfile: {
|
||||
$in: ids
|
||||
}}
|
||||
]
|
||||
],
|
||||
nonOrganicType: null
|
||||
};
|
||||
return DB.postCols.find(query).sort({lastUpdated: -1}).limit(20).toArray().then(async (posts)=>{
|
||||
return await filterPrivateGroups(posts, profile);
|
||||
@@ -176,6 +177,16 @@ postDB = (DB)=>{
|
||||
});
|
||||
}
|
||||
|
||||
DB.getNews = async () => {
|
||||
let query = {
|
||||
nonOrganicType: 'News'
|
||||
};
|
||||
return DB.postCols.find(query).sort({lastUpdated: -1}).limit(20).toArray().catch((err)=>{
|
||||
console.log(err);
|
||||
return [];
|
||||
});
|
||||
}
|
||||
|
||||
DB.getPostsOfUser = (userId) => {
|
||||
let userid = DB.ObjectID(userId);
|
||||
console.log("getPostsOfUser")
|
||||
|
||||
Reference in New Issue
Block a user