Skip to content

Commit 41bdd55

Browse files
committed
fix(next-drupal): use NextDrupalBase in enableDraftMode()
Fixes #749
1 parent b539450 commit 41bdd55

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/next-drupal/src/draft.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import {
55
DRAFT_MODE_COOKIE_NAME,
66
} from "./draft-constants"
77
import type { NextRequest } from "next/server"
8-
import type { NextDrupal } from "./next-drupal"
8+
import type { NextDrupalBase } from "./next-drupal-base"
99

1010
export async function enableDraftMode(
1111
request: NextRequest,
12-
drupal: NextDrupal
12+
drupal: NextDrupalBase
1313
): Promise<Response | never> {
1414
// Validate the draft request.
1515
const response = await drupal.validateDraftUrl(request.nextUrl.searchParams)

packages/next-drupal/tests/draft/draft.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { NextRequest } from "next/server"
1212
import {
1313
DRAFT_DATA_COOKIE_NAME,
1414
DRAFT_MODE_COOKIE_NAME,
15-
NextDrupal,
15+
NextDrupalBase,
1616
} from "../../src"
1717
import { BASE_URL, spyOnFetch } from "../utils"
1818
import {
@@ -50,7 +50,7 @@ describe("enableDraftMode()", () => {
5050
const request = new NextRequest(
5151
`https://example.com/api/draft?${searchParams}`
5252
)
53-
const drupal = new NextDrupal(BASE_URL)
53+
const drupal = new NextDrupalBase(BASE_URL)
5454
const draftModeCookie: ResponseCookie = {
5555
name: DRAFT_MODE_COOKIE_NAME,
5656
value: "some-secret-key",

0 commit comments

Comments
 (0)