Skip to content

Commit aaa69fc

Browse files
handle possible NotionCompatAPI without search
1 parent 6bd2d86 commit aaa69fc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

examples/full/lib/notion.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,11 @@ export async function getPage(pageId: string): Promise<ExtendedRecordMap> {
2828
}
2929

3030
export async function search(params: SearchParams): Promise<SearchResults> {
31-
return notion.search(params)
31+
if (notion instanceof NotionAPI) {
32+
return notion.search(params)
33+
} else {
34+
console.error(
35+
'NotionCompatAPI does not have a search method. Use NotionAPI instead.'
36+
)
37+
}
3238
}

0 commit comments

Comments
 (0)