export const dynamic = "force-dynamic"; // This disables SSG and ISR import Form from "next/form"; import prisma from "@/lib/prisma"; import { revalidatePath } from "next/cache"; import { redirect } from "next/navigation"; export default function NewPost() { async function createPost(formData: FormData) { "use server"; const authorEmail = (formData.get("authorEmail") as string) || undefined; const title = formData.get("title") as string; const content = formData.get("content") as string; const postData = authorEmail ? { title, content, author: { connect: { email: authorEmail, }, }, } : { title, content, }; await prisma.post.create({ data: postData, }); revalidatePath("/posts"); redirect("/posts"); } return (