working on users having multiple profiles

This commit is contained in:
Adolfo Reyna
2021-08-17 11:28:45 -07:00
parent f909233533
commit 416c14d03b
9 changed files with 84 additions and 48 deletions

View File

@@ -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;