add private groups

This commit is contained in:
Adolfo Reyna
2021-09-25 21:20:41 -07:00
parent 83941c59d5
commit 070912f2d3
7 changed files with 77 additions and 30 deletions

View File

@@ -19,8 +19,15 @@ DB.getDB.then((DB)=>{
router.get("/usr/:id", async (req, res) => {
const profileId = req.params.id;
if(await DB.isGroupPrivate(profileId)){
let requestProfile = getProfileId(req) + "";
let group = await DB.getProfileCache(profileId);
if(!group.subscribed[requestProfile] && profileId != requestProfile){
return res.json([]);
}
}
const posts = await DB.getPosts(profileId);
return res.json(posts)
return res.json(posts);
});
router.post("/", async (req, res) => {