Skip to content

Commit fcf7e4b

Browse files
committed
fix api preview
1 parent 69750c8 commit fcf7e4b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎app/api/draft/route.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import { draftMode } from "next/headers";
88
import { redirect } from "next/navigation";
99

1010
import { client } from "@/sanity/lib/client";
11-
// import { token } from "@/sanity/lib/token";
11+
import { token } from "@/sanity/lib/token";
1212

13-
// const clientWithToken = client.withConfig({ token });
13+
const clientWithToken = client.withConfig({ token });
1414

1515
export async function GET(request: Request) {
1616
const { isValid, redirectTo = "/" } = await validatePreviewUrl(
17-
client,
17+
clientWithToken,
1818
request.url
1919
);
2020
if (!isValid) {

0 commit comments

Comments
 (0)