From 6d056914670dea580c0ce6d183a8958271398389 Mon Sep 17 00:00:00 2001 From: Ben Merckx Date: Tue, 19 Nov 2024 13:20:43 +0100 Subject: [PATCH] Only access normalized config in next cms adapter --- src/adapter/next/cms.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/adapter/next/cms.tsx b/src/adapter/next/cms.tsx index ab0aa6f7..6cafc49e 100644 --- a/src/adapter/next/cms.tsx +++ b/src/adapter/next/cms.tsx @@ -22,7 +22,7 @@ export interface PreviewProps { export class NextCMS< Definition extends Config = Config > extends CMS { - constructor(config: Definition, public baseUrl?: string) { + constructor(rawConfig: Definition, public baseUrl?: string) { let lastSync = 0 const init = PLazy.from(async () => { if (process.env.NEXT_RUNTIME === 'edge') throw 'assert' @@ -30,12 +30,12 @@ export class NextCMS< 'alinea/backend/store/GeneratedStore' ) const store = await generatedStore - const db = new Database(config, store) + const db = new Database(this.config, store) const previews = createPreviewParser(db) return {db, previews} }) - super(config, async () => { - const context = await requestContext(config) + super(rawConfig, async () => { + const context = await requestContext(this.config) const client = new Client({ config: this.config, url: context.handlerUrl.href,