Fix permissions to private groups on tag posts q

This commit is contained in:
aeroreyna
2022-12-30 09:26:15 -05:00
parent 84087adb82
commit fddce94cfb
2 changed files with 19 additions and 10 deletions

View File

@@ -103,7 +103,8 @@ DB.getDB.then((DB) => {
router.get("/usr/:id/images", async (req, res) => {
const profileid = req.params.id;
const posts = await DB.getMediaTagPostOfUser(profileid);
const viewerProfileId = getProfileId(req);
const posts = await DB.getMediaTagPostOfUser(profileid, viewerProfileId);
return res.json({
status: "ok",
posts
@@ -112,7 +113,8 @@ DB.getDB.then((DB) => {
router.get("/usr/:id/embedded", async (req, res) => {
const profileid = req.params.id;
const posts = await DB.getMediaTagPostOfUser(profileid, "@iframe:");
const viewerProfileId = getProfileId(req);
const posts = await DB.getMediaTagPostOfUser(profileid, viewerProfileId, "@iframe:");
return res.json({
status: "ok",
posts
@@ -121,7 +123,8 @@ DB.getDB.then((DB) => {
router.get("/usr/:id/media", async (req, res) => {
const profileid = req.params.id;
const posts = await DB.getMediaTagPostOfUser(profileid, "@youtube:|@vimeo:|@hls:");
const viewerProfileId = getProfileId(req);
const posts = await DB.getMediaTagPostOfUser(profileid, viewerProfileId, "@youtube:|@vimeo:|@hls:");
return res.json({
status: "ok",
posts
@@ -247,7 +250,7 @@ DB.getDB.then((DB) => {
router.get("/images", async (req, res) => {
const profileid = getProfileId(req);
const posts = await DB.getMediaTagPostOfUser(profileid);
const posts = await DB.getMediaTagPostOfUser(profileid, profileid);
return res.json({
status: "ok",
posts
@@ -256,7 +259,7 @@ DB.getDB.then((DB) => {
router.get("/embedded", async (req, res) => {
const profileid = getProfileId(req);
const posts = await DB.getMediaTagPostOfUser(profileid, "@iframe:");
const posts = await DB.getMediaTagPostOfUser(profileid, profileid, "@iframe:");
return res.json({
status: "ok",
posts
@@ -265,7 +268,7 @@ DB.getDB.then((DB) => {
router.get("/media", async (req, res) => {
const profileid = getProfileId(req);
const posts = await DB.getMediaTagPostOfUser(profileid, "@youtube:|@vimeo:|@hls:");
const posts = await DB.getMediaTagPostOfUser(profileid, profileid, "@youtube:|@vimeo:|@hls:");
return res.json({
status: "ok",
posts