From 34a92a265f9e0b5c61780f619711dd8da286f2a3 Mon Sep 17 00:00:00 2001 From: Max Leiter Date: Sat, 17 Dec 2022 16:28:49 -0800 Subject: [PATCH] Fix /new/from posts --- src/app/(posts)/new/from/[id]/page.tsx | 11 +++++++---- .../(posts)/post/[id]/components/post-files/index.tsx | 2 -- src/app/settings/components/sections/profile.tsx | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/app/(posts)/new/from/[id]/page.tsx b/src/app/(posts)/new/from/[id]/page.tsx index bd4e1e84..cbd2fc18 100644 --- a/src/app/(posts)/new/from/[id]/page.tsx +++ b/src/app/(posts)/new/from/[id]/page.tsx @@ -22,15 +22,18 @@ const NewFromExisting = async ({ } const post = await getPostById(id, { - include: { - files: true, - author: false - }, select: { authorId: true, title: true, description: true, id: true, + files: { + select: { + title: true, + content: true, + id: true, + } + } } }) diff --git a/src/app/(posts)/post/[id]/components/post-files/index.tsx b/src/app/(posts)/post/[id]/components/post-files/index.tsx index 32645427..d442017f 100644 --- a/src/app/(posts)/post/[id]/components/post-files/index.tsx +++ b/src/app/(posts)/post/[id]/components/post-files/index.tsx @@ -18,7 +18,6 @@ const PostFiles = ({ post: _initialPost, isAuthor: isAuthorFromServer }: Props) => { - console.log("PostFiles") const { data: session, status } = useSession() const isLoading = status === "loading" const initialPost = @@ -27,7 +26,6 @@ const PostFiles = ({ : _initialPost const [post, setPost] = useState(initialPost) const isProtected = initialPost.visibility === "protected" - console.log(_initialPost, post) // We generate public and unlisted posts at build time, so we can't use // the session to determine if the user is the author on the server. We need to check diff --git a/src/app/settings/components/sections/profile.tsx b/src/app/settings/components/sections/profile.tsx index d8b46957..e85b429f 100644 --- a/src/app/settings/components/sections/profile.tsx +++ b/src/app/settings/components/sections/profile.tsx @@ -60,7 +60,7 @@ const Profile = ({ user }: { user: User }) => { return ( <> - This information will be publicly available on your profile + This information will be publicly available on your profile.