From 509e2631b8623baca725c54b66cf97916708ef89 Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Wed, 10 Feb 2021 21:37:50 -0500 Subject: [PATCH] fix: use page id overrides in links --- lib/map-page-url.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/map-page-url.ts b/lib/map-page-url.ts index 488f684ead..79a18aaa06 100644 --- a/lib/map-page-url.ts +++ b/lib/map-page-url.ts @@ -1,14 +1,17 @@ -import * as types from './types' +import { ExtendedRecordMap } from 'notion-types' +import { uuidToId, parsePageId } from 'notion-utils' + +import { Site } from './types' import { includeNotionIdInUrls } from './config' -import { getCanonicalPageId, uuidToId, parsePageId } from 'notion-utils' +import { getCanonicalPageId } from './get-canonical-page-id' // include UUIDs in page URLs during local development but not in production // (they're nice for debugging and speed up local dev) const uuid = !!includeNotionIdInUrls export const mapPageUrl = ( - site: types.Site, - recordMap: types.ExtendedRecordMap, + site: Site, + recordMap: ExtendedRecordMap, searchParams: URLSearchParams ) => (pageId = '') => { if (uuidToId(pageId) === site.rootNotionPageId) { @@ -22,8 +25,8 @@ export const mapPageUrl = ( } export const getCanonicalPageUrl = ( - site: types.Site, - recordMap: types.ExtendedRecordMap + site: Site, + recordMap: ExtendedRecordMap ) => (pageId = '') => { const pageUuid = parsePageId(pageId, { uuid: true })