ソースを参照

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

tags/2.0.0-beta.1
twwu 2ヶ月前
コミット
ef64729771

+ 1
- 0
web/app/components/datasets/create/notion-page-preview/index.tsx ファイルの表示

const res = await fetchNotionPagePreview({ const res = await fetchNotionPagePreview({
workspaceID: currentPage.workspace_id, workspaceID: currentPage.workspace_id,
pageID: currentPage.page_id, pageID: currentPage.page_id,
pageType: currentPage.type,
credentialID: notionCredentialId, credentialID: notionCredentialId,
}) })
setPreviewContent(res.content) setPreviewContent(res.content)

+ 2
- 2
web/service/datasets.ts ファイルの表示

return post<FileIndexingEstimateResponse>('/datasets/indexing-estimate', { body }) 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: { params: {
credential_id: credentialID, credential_id: credentialID,
}, },

読み込み中…
キャンセル
保存