mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-14 15:11:13 +00:00
fix collection tags create (#5117)
This commit is contained in:
@@ -37,7 +37,6 @@ import {
|
||||
} from '@fastgpt/global/core/dataset/training/utils';
|
||||
import { DatasetDataIndexTypeEnum } from '@fastgpt/global/core/dataset/data/constants';
|
||||
import { clearCollectionImages, removeDatasetImageExpiredTime } from '../image/utils';
|
||||
import { MongoDatasetCollectionTags } from '../tag/schema';
|
||||
|
||||
export const createCollectionAndInsertData = async ({
|
||||
dataset,
|
||||
@@ -280,7 +279,7 @@ export async function createOneCollection({ session, ...props }: CreateOneCollec
|
||||
teamId,
|
||||
parentId,
|
||||
datasetId,
|
||||
tags: tagIdList,
|
||||
tags,
|
||||
|
||||
fileId,
|
||||
rawLink,
|
||||
@@ -288,15 +287,9 @@ export async function createOneCollection({ session, ...props }: CreateOneCollec
|
||||
externalFileUrl,
|
||||
apiFileId
|
||||
} = props;
|
||||
// Create collection tags
|
||||
const tags = await MongoDatasetCollectionTags.find({
|
||||
teamId,
|
||||
datasetId,
|
||||
_id: { $in: tagIdList }
|
||||
});
|
||||
|
||||
const collectionTags = await createOrGetCollectionTags({
|
||||
tags: tags.map((item) => item.tag),
|
||||
tags,
|
||||
teamId,
|
||||
datasetId,
|
||||
session
|
||||
|
@@ -194,7 +194,11 @@ export const syncCollection = async (collection: CollectionWithDatasetType) => {
|
||||
createCollectionParams: {
|
||||
...collection,
|
||||
name: title || collection.name,
|
||||
updateTime: new Date()
|
||||
updateTime: new Date(),
|
||||
tags: await collectionTagsToTagLabel({
|
||||
datasetId: collection.datasetId,
|
||||
tags: collection.tags
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user