diff --git a/client/src/pages/CommunityPage.tsx b/client/src/pages/CommunityPage.tsx
index 51660bf..278175c 100644
--- a/client/src/pages/CommunityPage.tsx
+++ b/client/src/pages/CommunityPage.tsx
@@ -261,8 +261,7 @@ export default function CommunityPage() {
handleImageError(post.id)}
- />
+ onError={() => handleImageError(post.id)} />
)}
diff --git a/client/src/pages/PostPage.tsx b/client/src/pages/PostPage.tsx
index 22af39a..e3c8ceb 100644
--- a/client/src/pages/PostPage.tsx
+++ b/client/src/pages/PostPage.tsx
@@ -54,10 +54,18 @@ const PostPage: React.FC = () => {
useEffect(() => {
if (id) {
+ console.log("useEffect for fetching post called, id:", id);
instance.get(`${config.serverAddress}/post/${id}`)
- .then((res) => setPost(res.data))
+ .then((res) => {
+ setPost(res.data);
+ console.log("Post fetch successfully");
+ })
.catch((error) => console.error("Error fetching post:", error));
}
+ }, [id]);
+
+ useEffect(() => {
+ console.log("PostPage component mounted");
}, []);
useEffect(() => {
@@ -189,7 +197,8 @@ const PostPage: React.FC = () => {
{!imageErrorFlags[post.id] && post.postImage && post.postImage !== null && (