Revalidate prisma query in `page.ts` RSC
I'm getting the same data every time I visit this route.
Is there a way to revalidate prisma queries in a RSC?
Is there a way to revalidate prisma queries in a RSC?
import { prisma } from "@acme/db";
import EditForm from "./edit-form";
export default async function Page({ params }: { params: { id: string } }) {
const account = await prisma.account.findUnique({
where: {
id: Number(params.id),
}
})
if (!account) return "Account doesn't exist";
return <EditForm account={account} />;
}export const revalidate = 0;revalidate and all the other functions like revalidatePath and revalidateTags all seem to work only for the fetch implementation next team made, not for prismaexport const dynamic = "force-dynamic" help?fetch() functions?/app/page.tsxrevalidatePath() to do what the name of the function suggests
export const revalidate = 0;revalidaterevalidatePathrevalidateTagsexport const dynamic = "force-dynamic"fetch()/app/page.tsxrevalidatePath()// page.tsx
import AddForm from "./add-form";
export const revalidate = 0;
export default function Page() {
return <AddForm />;
}// add-form.tsx
router.refresh();
router.push("/");