News post emails
This commit is contained in:
@@ -167,7 +167,7 @@ postDB = (DB)=>{
|
||||
$in: ids
|
||||
}}
|
||||
],
|
||||
nonOrganicType: null
|
||||
nonOrganicType: null // Exlcude news
|
||||
};
|
||||
return DB.postCols.find(query).sort({lastUpdated: -1}).limit(20).toArray().then(async (posts)=>{
|
||||
return await filterPrivateGroups(posts, profile);
|
||||
|
||||
@@ -40,13 +40,17 @@ userDB = (DB) => {
|
||||
DB.getProfile = async (profileId) => {
|
||||
//if (userProfileCache[profileId] && !userProfileCache[profileId].isGroup) return userProfileCache[profileId];
|
||||
if(!profileId) return false;
|
||||
const _id = DB.ObjectID(profileId);
|
||||
let r = await DB.profileCols.findOne({ _id }).catch((err) => {
|
||||
console.log(err);
|
||||
return false;
|
||||
});
|
||||
if (r) userProfileCache[profileId] = r;
|
||||
return r;
|
||||
try{
|
||||
const _id = DB.ObjectID(profileId);
|
||||
let r = await DB.profileCols.findOne({ _id }).catch((err) => {
|
||||
console.log(err);
|
||||
return false;
|
||||
});
|
||||
if (r) userProfileCache[profileId] = r;
|
||||
return r;
|
||||
}catch(_){
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
DB.getPopularProfiles = async (limit = 10) => {
|
||||
|
||||
Reference in New Issue
Block a user