Commit 0c51b423 authored by StyleZhang's avatar StyleZhang

fix: notion page type

parent 4354b680
......@@ -152,7 +152,7 @@ const Documents: FC<IDocumentsProps> = ({ datasetId }) => {
}
const handleSync = async () => {
if (dataset?.data_source_type === 'notion_import')
if (dataset?.data_source_type === DataSourceType.NOTION)
mutate()
}
......@@ -174,7 +174,7 @@ const Documents: FC<IDocumentsProps> = ({ datasetId }) => {
<Button type='primary' onClick={routeToDocCreate} className='!h-8 !text-[13px]'>
<PlusIcon className='h-4 w-4 mr-2 stroke-current' />
{
dataset?.data_source_type === 'notion_import'
dataset?.data_source_type === DataSourceType.NOTION
? t('datasetDocuments.list.addPages')
: t('datasetDocuments.list.addFile')
}
......
......@@ -260,7 +260,7 @@ type IDocumentListProps = {
/**
* Document list component including basic information
*/
const DocumentList: FC<IDocumentListProps> = ({ documents = [], datasetId, onUpdate, onSync }) => {
const DocumentList: FC<IDocumentListProps> = ({ documents = [], datasetId, onUpdate }) => {
const { t } = useTranslation()
const router = useRouter()
const [localDocs, setLocalDocs] = useState<DocumentListResponse['data']>(documents)
......
import type { AppMode } from './app'
import type { DataSourceNotionPage } from './common'
export enum DataSourceType {
FILE = 'upload_file',
......@@ -182,7 +183,7 @@ export type DataSource = {
export type NotionInfo = {
workspace_id: string
pages: NotionPage[]
pages: DataSourceNotionPage[]
}
export type NotionPage = {
page_id: string
......
......@@ -107,6 +107,10 @@ export const modifyDocMetadata: Fetcher<CommonResponse, CommonDocReq & { body: {
return put(`/datasets/${datasetId}/documents/${documentId}/metadata`, { body }) as Promise<CommonResponse>
}
export const getDatasetIndexingStatus: Fetcher<{ data: IndexingStatusResponse[] }, string> = (datasetId) => {
return get(`/datasets/${datasetId}/indexing-status`) as Promise<{ data: IndexingStatusResponse[] }>
}
// apis for segments in a document
export const fetchSegments: Fetcher<SegmentsResponse, CommonDocReq & { params: SegmentsQuery }> = ({ datasetId, documentId, params }) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment