diff --git a/examples/content-source-maps-graphql/app/api/disable-draft/route.ts b/examples/content-source-maps-graphql/app/api/disable-draft/route.ts index 128e6852..6224d6d1 100644 --- a/examples/content-source-maps-graphql/app/api/disable-draft/route.ts +++ b/examples/content-source-maps-graphql/app/api/disable-draft/route.ts @@ -1,6 +1,6 @@ import { draftMode } from 'next/headers'; export async function GET(request: Request) { - draftMode().disable(); + (await draftMode()).disable(); return new Response('Draft mode is disabled'); } diff --git a/examples/content-source-maps-graphql/app/api/enable-draft/route.ts b/examples/content-source-maps-graphql/app/api/enable-draft/route.ts index a8057746..85cd2077 100644 --- a/examples/content-source-maps-graphql/app/api/enable-draft/route.ts +++ b/examples/content-source-maps-graphql/app/api/enable-draft/route.ts @@ -17,13 +17,13 @@ export async function GET(request: Request) { } // Enable Draft Mode by setting the cookie - draftMode().enable(); + (await draftMode()).enable(); // Override cookie header for draft mode for usage in live-preview // https://github.com/vercel/next.js/issues/49927 - const cookieStore = cookies(); + const cookieStore = await cookies(); const cookie = cookieStore.get('__prerender_bypass')!; - cookies().set({ + cookieStore.set({ name: '__prerender_bypass', value: cookie?.value, httpOnly: true, diff --git a/examples/content-source-maps-graphql/app/layout.tsx b/examples/content-source-maps-graphql/app/layout.tsx index dd7ef0da..5ff4894d 100644 --- a/examples/content-source-maps-graphql/app/layout.tsx +++ b/examples/content-source-maps-graphql/app/layout.tsx @@ -7,12 +7,12 @@ export const metadata: Metadata = { description: 'Generated by create next app', }; -export default function RootLayout({ +export default async function RootLayout({ children, }: Readonly<{ children: React.ReactNode; }>) { - const { isEnabled } = draftMode(); + const { isEnabled } = await draftMode(); return (