Update packages/nodes-base/nodes/Notion/shared/GenericFunctions.ts

Co-authored-by: Elias Meire <elias@meire.dev>
This commit is contained in:
Michael Kret 2024-11-08 16:38:37 +02:00 committed by GitHub
parent 1adb83e902
commit b033dadfd8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -926,7 +926,7 @@ export function getPageId(this: IExecuteFunctions, i: number) {
pageId = page.value;
} else if (page.value.includes('p=')) {
// e.g https://www.notion.so/xxxxx?v=xxxxx&p=xxxxx&pm=s
pageId = page.value.split('p=')[1].split('&')[0];
pageId = new URLSearchParams(page.value).get('p')
} else {
// e.g https://www.notion.so/page_name-xxxxx
pageId = page.value.match(databasePageUrlValidationRegexp)?.[1] || '';