Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
fix: notion parse
Marc Seitz552fee3b7d2f
diff --git a/components/documents/add-document-modal.tsx b/components/documents/add-document-modal.tsxindex c190f156..e7a8ad85 100644--- a/components/documents/add-document-modal.tsx+++ b/components/documents/add-document-modal.tsx@@ -411,9 +411,7 @@ export function AddDocumentModal({if (validateNotionPageId === null) {try {const pageId = await getNotionPageIdFromSlug(notionLink);- if (pageId) {- validateNotionPageId = pageId;- }+ validateNotionPageId = pageId || undefined;} catch (slugError) {toast.error("Please enter a valid Notion link to proceed.");return;diff --git a/lib/api/documents/process-document.ts b/lib/api/documents/process-document.tsindex 12ad63c6..ba64f6a5 100644--- a/lib/api/documents/process-document.ts+++ b/lib/api/documents/process-document.ts@@ -55,7 +55,8 @@ export const processDocument = async ({// If parsePageId fails, try to get page ID from slugif (!pageId) {try {- pageId = await getNotionPageIdFromSlug(key);+ const pageIdFromSlug = await getNotionPageIdFromSlug(key);+ pageId = pageIdFromSlug || undefined;} catch (slugError) {throw new Error("Unable to extract page ID from Notion URL");}