sending emails when new post to profiles
This commit is contained in:
@@ -23,6 +23,17 @@ userDB = (DB) => {
|
||||
return r;
|
||||
}
|
||||
|
||||
DB.getProfileCache = async (profileId) => {
|
||||
if (userProfileCache[profileId] && !userProfileCache[profileId].isGroup) return userProfileCache[profileId];
|
||||
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;
|
||||
}
|
||||
|
||||
DB.getProfiles = async (query) => {
|
||||
let r = await DB.profileCols.find({isGroup: false})
|
||||
.sort({ lastUpdate: -1 }).limit(20)
|
||||
|
||||
Reference in New Issue
Block a user