From ef6b4dfef79dcd972702b7443ce499f3e6dcd08c Mon Sep 17 00:00:00 2001 From: Chris Bonifacio Date: Wed, 12 Jun 2024 17:10:52 -0400 Subject: [PATCH 1/2] Update Post.tsx --- src/components/Post.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Post.tsx b/src/components/Post.tsx index f1de94f..6891fc3 100644 --- a/src/components/Post.tsx +++ b/src/components/Post.tsx @@ -8,7 +8,7 @@ const Post = ({ onDelete, isSignedIn, }: { - post: Pick; + post: Pick; onDelete: (id: string) => void; isSignedIn: boolean; }) => { From 8d19dde2393d379ddfa28eb4aa9272b78ab37f63 Mon Sep 17 00:00:00 2001 From: Chris Bonifacio Date: Wed, 12 Jun 2024 17:15:45 -0400 Subject: [PATCH 2/2] update types --- src/app/_actions/actions.ts | 2 +- src/app/posts/[id]/page.tsx | 2 +- src/components/AddComment.tsx | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/app/_actions/actions.ts b/src/app/_actions/actions.ts index dd13139..0dbef4b 100644 --- a/src/app/_actions/actions.ts +++ b/src/app/_actions/actions.ts @@ -17,7 +17,7 @@ export async function deleteComment(formData: FormData) { export async function addComment( content: string, - post: Schema["Post"], + post: Schema["Post"]["type"], paramsId: string ) { if (content.trim().length === 0) return; diff --git a/src/app/posts/[id]/page.tsx b/src/app/posts/[id]/page.tsx index 990f4c1..488cce5 100644 --- a/src/app/posts/[id]/page.tsx +++ b/src/app/posts/[id]/page.tsx @@ -38,7 +38,7 @@ const Posts = async ({ params }: { params: { id: string } }) => { ) : null} diff --git a/src/components/AddComment.tsx b/src/components/AddComment.tsx index 38c0bf5..ed84afd 100644 --- a/src/components/AddComment.tsx +++ b/src/components/AddComment.tsx @@ -7,8 +7,12 @@ const Comments = ({ post, paramsId, }: { - addComment: (content: string, post: Schema["Post"], paramsId: string) => void; - post: Schema["Post"]; + addComment: ( + content: string, + post: Schema["Post"]["type"], + paramsId: string + ) => void; + post: Schema["Post"]["type"]; paramsId: string; }) => { const [comment, setComment] = useState("");