refactor(notion-page-preview): update fetchNotionPagePreview to include pageType parameter for improved API request

This commit is contained in:
twwu 2025-09-04 19:02:35 +08:00
parent 771ea54a0b
commit ef64729771
2 changed files with 3 additions and 2 deletions

View File

@ -31,6 +31,7 @@ const NotionPagePreview = ({
const res = await fetchNotionPagePreview({
workspaceID: currentPage.workspace_id,
pageID: currentPage.page_id,
pageType: currentPage.type,
credentialID: notionCredentialId,
})
setPreviewContent(res.content)

View File

@ -183,8 +183,8 @@ export const fetchFileIndexingEstimate: Fetcher<FileIndexingEstimateResponse, In
return post<FileIndexingEstimateResponse>('/datasets/indexing-estimate', { body })
}
export const fetchNotionPagePreview: Fetcher<{ content: string }, { workspaceID: string; pageID: string; credentialID: string; }> = ({ workspaceID, pageID, credentialID }) => {
return get<{ content: string }>(`notion/workspaces/${workspaceID}/pages/${pageID}/preview`, {
export const fetchNotionPagePreview: Fetcher<{ content: string }, { workspaceID: string; pageID: string; pageType: string; credentialID: string; }> = ({ workspaceID, pageID, pageType, credentialID }) => {
return get<{ content: string }>(`notion/workspaces/${workspaceID}/pages/${pageID}/${pageType}/preview`, {
params: {
credential_id: credentialID,
},