working on users having multiple profiles
This commit is contained in:
@@ -77,8 +77,13 @@ postDB = (DB)=>{
|
||||
});
|
||||
}
|
||||
|
||||
DB.getPosts = (userid) => {
|
||||
let query = userid ? {userid} : {};
|
||||
DB.getPosts = (profileId) => {
|
||||
let query = profileId ? {
|
||||
$or: [
|
||||
{_id: profileId},
|
||||
{toUser: profileId}
|
||||
]
|
||||
} : {};
|
||||
return DB.postCols.find(query).sort({_id: -1}).toArray().catch((err)=>{
|
||||
console.log(err);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user