({ params }: EditorPageProps)
| 20 | } |
| 21 | |
| 22 | export default async function EditorPage({ params }: EditorPageProps) { |
| 23 | const user = await getCurrentUser() |
| 24 | |
| 25 | if (!user) { |
| 26 | redirect(authOptions?.pages?.signIn || "/login") |
| 27 | } |
| 28 | |
| 29 | const post = await getPostForUser(params.postId, user.id) |
| 30 | |
| 31 | if (!post) { |
| 32 | notFound() |
| 33 | } |
| 34 | |
| 35 | return ( |
| 36 | <Editor |
| 37 | post={{ |
| 38 | id: post.id, |
| 39 | title: post.title, |
| 40 | content: post.content, |
| 41 | published: post.published, |
| 42 | }} |
| 43 | /> |
| 44 | ) |
| 45 | } |
nothing calls this directly
no test coverage detected