From 2d82db01a9f285facdd8c9cf489dd1cc2a814bda Mon Sep 17 00:00:00 2001 From: heheer Date: Wed, 15 Jan 2025 14:47:09 +0800 Subject: [PATCH] fix: api dataset reference tag preview (#3600) --- packages/service/core/dataset/search/controller.ts | 4 ++-- projects/app/src/components/core/dataset/RawSourceBox.tsx | 4 +--- .../Flow/nodes/render/RenderInput/templates/SelectDataset.tsx | 2 -- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/service/core/dataset/search/controller.ts b/packages/service/core/dataset/search/controller.ts index 0de4c2884d3b..7a3ea9a3f796 100644 --- a/packages/service/core/dataset/search/controller.ts +++ b/packages/service/core/dataset/search/controller.ts @@ -284,7 +284,7 @@ export async function searchDatasetData(props: SearchDatasetDataProps) { { _id: { $in: collectionIdList } }, - '_id name fileId rawLink externalFileId externalFileUrl', + '_id name fileId rawLink apiFileId externalFileId externalFileUrl', { ...readFromSecondary } ).lean() ]); @@ -525,7 +525,7 @@ export async function searchDatasetData(props: SearchDatasetDataProps) { { _id: { $in: searchResults.map((item) => item.collectionId) } }, - '_id name fileId rawLink externalFileId externalFileUrl', + '_id name fileId rawLink apiFileId externalFileId externalFileUrl', { ...readFromSecondary } ).lean() ]); diff --git a/projects/app/src/components/core/dataset/RawSourceBox.tsx b/projects/app/src/components/core/dataset/RawSourceBox.tsx index 7957adfe0ee7..4b860d8dc0aa 100644 --- a/projects/app/src/components/core/dataset/RawSourceBox.tsx +++ b/projects/app/src/components/core/dataset/RawSourceBox.tsx @@ -5,7 +5,6 @@ import { useTranslation } from 'next-i18next'; import { getCollectionSourceAndOpen } from '@/web/core/dataset/hooks/readCollectionSource'; import { getSourceNameIcon } from '@fastgpt/global/core/dataset/utils'; import MyIcon from '@fastgpt/web/components/common/Icon'; -import { useI18n } from '@/web/context/I18n'; import type { readCollectionSourceBody } from '@/pages/api/core/dataset/collection/read'; type Props = BoxProps & @@ -33,7 +32,6 @@ const RawSourceBox = ({ ...props }: Props) => { const { t } = useTranslation(); - const { fileT } = useI18n(); const canPreview = !!sourceId && canView; @@ -51,7 +49,7 @@ const RawSourceBox = ({ return ( {t('workflow:auth_tmb_id')}