fixing image display for posts on profile page, adding success confirmation modal, changing posts display,

This commit is contained in:
Will Baumbach
2025-08-06 13:36:47 -05:00
parent ed4e1089ee
commit 878e18941e
8 changed files with 187 additions and 210 deletions

View File

@@ -36,13 +36,17 @@ export const getPost = async (req, res, next) => {
}
export const getAllPostsByUser = async (req, res, next) => {
const post = await Post.find({ email: req.params.user }).exec()
if (!post) {
console.log(req.params)
const posts = await Post.find({ userID: req.params.user }).exec()
posts.map((el) => {
el.photo = process.env.CLOUDFRONT_URL + el.photo
})
if (!posts) {
return next('No document found with that id', 404)
}
res.status(200).json({
status: 'success',
data: post
data: posts
})
}