Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
58160409
authored
Jun 30, 2025
by
heheer
Committed by
GitHub
Jun 30, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix collection tags create (#5117)
parent
1eb98ef0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
11 deletions
+13
-11
packages/service/core/dataset/collection/controller.ts
+2
-9
packages/service/core/dataset/collection/utils.ts
+5
-1
projects/app/src/pages/api/core/dataset/collection/create/reTrainingCollection.ts
+6
-1
No files found.
packages/service/core/dataset/collection/controller.ts
View file @
58160409
...
@@ -37,7 +37,6 @@ import {
...
@@ -37,7 +37,6 @@ import {
}
from
'@fastgpt/global/core/dataset/training/utils'
;
}
from
'@fastgpt/global/core/dataset/training/utils'
;
import
{
DatasetDataIndexTypeEnum
}
from
'@fastgpt/global/core/dataset/data/constants'
;
import
{
DatasetDataIndexTypeEnum
}
from
'@fastgpt/global/core/dataset/data/constants'
;
import
{
clearCollectionImages
,
removeDatasetImageExpiredTime
}
from
'../image/utils'
;
import
{
clearCollectionImages
,
removeDatasetImageExpiredTime
}
from
'../image/utils'
;
import
{
MongoDatasetCollectionTags
}
from
'../tag/schema'
;
export
const
createCollectionAndInsertData
=
async
({
export
const
createCollectionAndInsertData
=
async
({
dataset
,
dataset
,
...
@@ -280,7 +279,7 @@ export async function createOneCollection({ session, ...props }: CreateOneCollec
...
@@ -280,7 +279,7 @@ export async function createOneCollection({ session, ...props }: CreateOneCollec
teamId
,
teamId
,
parentId
,
parentId
,
datasetId
,
datasetId
,
tags
:
tagIdList
,
tags
,
fileId
,
fileId
,
rawLink
,
rawLink
,
...
@@ -288,15 +287,9 @@ export async function createOneCollection({ session, ...props }: CreateOneCollec
...
@@ -288,15 +287,9 @@ export async function createOneCollection({ session, ...props }: CreateOneCollec
externalFileUrl
,
externalFileUrl
,
apiFileId
apiFileId
}
=
props
;
}
=
props
;
// Create collection tags
const
tags
=
await
MongoDatasetCollectionTags
.
find
({
teamId
,
datasetId
,
_id
:
{
$in
:
tagIdList
}
});
const
collectionTags
=
await
createOrGetCollectionTags
({
const
collectionTags
=
await
createOrGetCollectionTags
({
tags
:
tags
.
map
((
item
)
=>
item
.
tag
)
,
tags
,
teamId
,
teamId
,
datasetId
,
datasetId
,
session
session
...
...
packages/service/core/dataset/collection/utils.ts
View file @
58160409
...
@@ -194,7 +194,11 @@ export const syncCollection = async (collection: CollectionWithDatasetType) => {
...
@@ -194,7 +194,11 @@ export const syncCollection = async (collection: CollectionWithDatasetType) => {
createCollectionParams
:
{
createCollectionParams
:
{
...
collection
,
...
collection
,
name
:
title
||
collection
.
name
,
name
:
title
||
collection
.
name
,
updateTime
:
new
Date
()
updateTime
:
new
Date
(),
tags
:
await
collectionTagsToTagLabel
({
datasetId
:
collection
.
datasetId
,
tags
:
collection
.
tags
})
}
}
});
});
});
});
...
...
projects/app/src/pages/api/core/dataset/collection/create/reTrainingCollection.ts
View file @
58160409
...
@@ -10,6 +10,7 @@ import { WritePermissionVal } from '@fastgpt/global/support/permission/constant'
...
@@ -10,6 +10,7 @@ import { WritePermissionVal } from '@fastgpt/global/support/permission/constant'
import
{
addAuditLog
}
from
'@fastgpt/service/support/user/audit/util'
;
import
{
addAuditLog
}
from
'@fastgpt/service/support/user/audit/util'
;
import
{
AuditEventEnum
}
from
'@fastgpt/global/support/user/audit/constants'
;
import
{
AuditEventEnum
}
from
'@fastgpt/global/support/user/audit/constants'
;
import
{
getI18nDatasetType
}
from
'@fastgpt/service/support/user/audit/util'
;
import
{
getI18nDatasetType
}
from
'@fastgpt/service/support/user/audit/util'
;
import
{
collectionTagsToTagLabel
}
from
'@fastgpt/service/core/dataset/collection/utils'
;
type
RetrainingCollectionResponse
=
{
type
RetrainingCollectionResponse
=
{
collectionId
:
string
;
collectionId
:
string
;
...
@@ -47,7 +48,11 @@ async function handler(
...
@@ -47,7 +48,11 @@ async function handler(
createCollectionParams
:
{
createCollectionParams
:
{
...
collection
,
...
collection
,
...
data
,
...
data
,
updateTime
:
new
Date
()
updateTime
:
new
Date
(),
tags
:
await
collectionTagsToTagLabel
({
datasetId
:
collection
.
datasetId
,
tags
:
collection
.
tags
})
}
}
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment