Skip to content

Commit 8f9082e

Browse files
committed
Fallback when notion is missing
1 parent 094247e commit 8f9082e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/notion/notion.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,9 @@ const blockToMarkdown = async (block: any, depth: number = 0): Promise<string> =
111111
const DATABASE_ID = process.env.NOTION_DATABASE_ID as string;
112112

113113
export const fetchDocumentsFromKnowledgeBase = async (databaseId = DATABASE_ID) => {
114+
if (!process.env.NOTION_API_KEY) {
115+
return []
116+
}
117+
114118
return fetchDatabasePages(databaseId);
115119
}

0 commit comments

Comments
 (0)