changing posts to reference clerkUserID rather than id in mongodb

This commit is contained in:
Will Baumbach
2025-08-06 23:24:43 -05:00
parent 482bc915a5
commit 0af55853f6
5 changed files with 7 additions and 5 deletions

View File

@@ -37,7 +37,7 @@ export const getPost = async (req, res, next) => {
export const getAllPostsByUser = async (req, res, next) => {
console.log(req.params)
const posts = await Post.find({ userID: req.params.user }).exec()
const posts = await Post.find({ clerkUserID: req.params.id }).exec()
posts.map((el) => {
el.photo = process.env.CLOUDFRONT_URL + el.photo
})