Browse Source

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

tags/2.0.0-beta.1
twwu 1 month ago
parent
commit
ef64729771

+ 1
- 0
web/app/components/datasets/create/notion-page-preview/index.tsx 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)

+ 2
- 2
web/service/datasets.ts 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,
},

Loading…
Cancel
Save