Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/_actions/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/app/posts/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Posts = async ({ params }: { params: { id: string } }) => {
<AddComment
addComment={addComment}
paramsId={params.id}
post={post as Schema["Post"]}
post={post as Schema["Post"]["type"]}
/>
) : null}

Expand Down
8 changes: 6 additions & 2 deletions src/components/AddComment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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("");
Expand Down
2 changes: 1 addition & 1 deletion src/components/Post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Post = ({
onDelete,
isSignedIn,
}: {
post: Pick<Schema["Post"], "title" | "id">;
post: Pick<Schema["Post"]["type"], "title" | "id">;
onDelete: (id: string) => void;
isSignedIn: boolean;
}) => {
Expand Down