diff --git a/src/app/(afterLogin)/_component/Post.tsx b/src/app/(afterLogin)/_component/Post.tsx index 37ce846..9a64aa6 100644 --- a/src/app/(afterLogin)/_component/Post.tsx +++ b/src/app/(afterLogin)/_component/Post.tsx @@ -26,8 +26,7 @@ export default function Post({ post }: { post: any }) { } // 이미지 유효하지 않은 경우 디폴트 이미지 적용 - const profileImageUrl = - post?.user?.profileImage?.link || "/default_profile_img.svg"; + const profileImageUrl = post?.user?.profileImage?.url || "/default_profile_img.svg"; return (
diff --git a/src/app/(afterLogin)/_component/PostImages.tsx b/src/app/(afterLogin)/_component/PostImages.tsx index 9cc19c3..89b2334 100644 --- a/src/app/(afterLogin)/_component/PostImages.tsx +++ b/src/app/(afterLogin)/_component/PostImages.tsx @@ -10,51 +10,56 @@ import { } from "./PostStyle"; type Image = { - imageId: number; - link: string; + id: number; + url: string; }; type Props = { post: { postId: number; content: string; - User: { - id: string; - nickname: string; - image: string; + user: { + userId: number; + name: string; + customId: string; + profileImage: { + name: string; + url: string; + }; }; - createdAt: Date; - Images: Image[]; - isLikedByUser: boolean; + createdAt: string; + images: Image[]; }; }; export default function PostImages({ post }: Props) { - if (!post?.Images || post?.Images.length === 0) return null; + if (!post?.images || post?.images.length === 0) return null; - if (post.Images.length === 1) { - const image = post.Images[0]; + console.log(post.images); // post.images가 제대로 출력되는지 확인 + + if (post.images.length === 1) { + const image = post.images[0]; return ( - {`image-${image.imageId}`} + {`image-${image.id}`} ); } - if (post.Images.length === 2) { + if (post.images.length === 2) { return ( - {post.Images.map((image) => ( + {post.images.map((image) => ( ))} @@ -62,22 +67,22 @@ export default function PostImages({ post }: Props) { ); } - if (post.Images.length === 3) { + if (post.images.length === 3) { return ( @@ -85,15 +90,15 @@ export default function PostImages({ post }: Props) { ); } - if (post.Images.length === 4) { + if (post.images.length === 4) { return ( - {post.Images.map((image) => ( + {post.images.map((image) => ( ))} diff --git a/src/app/(afterLogin)/home/page.tsx b/src/app/(afterLogin)/home/page.tsx index 21ff006..aedfbd5 100644 --- a/src/app/(afterLogin)/home/page.tsx +++ b/src/app/(afterLogin)/home/page.tsx @@ -81,7 +81,7 @@ export default function Home() { )) ) : ( -
No posts available
+
)} );