Fix /new/from posts
This commit is contained in:
parent
ff310a67b9
commit
34a92a265f
3 changed files with 8 additions and 7 deletions
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -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<PostWithFilesAndAuthor>(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
|
||||
|
|
|
@ -60,7 +60,7 @@ const Profile = ({ user }: { user: User }) => {
|
|||
return (
|
||||
<>
|
||||
<Note type="warning">
|
||||
This information will be publicly available on your profile
|
||||
This information will be publicly available on your profile.
|
||||
</Note>
|
||||
<form onSubmit={onSubmit} className={styles.form}>
|
||||
<div>
|
||||
|
|
Loading…
Reference in a new issue