Add promotional endpoint (extended) for new users

This commit is contained in:
Adolfo Reyna
2025-02-05 20:46:24 -05:00
parent bf2cdd4696
commit 309ae1b69b
2 changed files with 39 additions and 11 deletions

View File

@@ -82,7 +82,16 @@ DB.getDB.then((DB) => {
let organicPosts = await DB.getFeed(profileid);
//Add non-organic posts
const nonOrganicPosts = await generateNonOrganicPosts(req, profileid);
const posts = mergePosts(organicPosts, nonOrganicPosts);
const posts = mergePosts(promotionalPosts, nonOrganicPosts);
return res.json(posts);
});
router.get("/extended", async (req, res) => {
const profileid = getProfileId(req);
//Add non-organic posts
const nonOrganicPosts = await generateNonOrganicPosts(req, profileid);
let promotionalPosts = await DB.getPromotionalPosts(profileid);
const posts = mergePosts(promotionalPosts, nonOrganicPosts);
return res.json(posts);
});