Commit d57b805e authored by Janka Uryga's avatar Janka Uryga

test: fix static GETs

parent 0ab52398
import { draftMode } from 'next/headers' import { draftMode } from 'next/headers'
// BACKPORT: GETs are static by default in 14.x
export const dynamic = 'force-dynamic'
export async function GET(request: Request) { export async function GET(request: Request) {
draftMode().disable() draftMode().disable()
return new Response('Draft mode is disabled') return new Response('Draft mode is disabled')
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
import { draftMode } from 'next/headers' import { draftMode } from 'next/headers'
import { redirect } from 'next/navigation' import { redirect } from 'next/navigation'
// BACKPORT: GETs are static by default in 14.x
export const dynamic = 'force-dynamic'
// Preview URL: localhost:3000/api/draft?secret=secret-token&slug=preview-page // Preview URL: localhost:3000/api/draft?secret=secret-token&slug=preview-page
export async function GET(request: Request) { export async function GET(request: Request) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment