Skip to content

Commit 59ed339

Browse files
dingzhenznendreamer6680
authored andcommitted
fix:collection search (labring#5217)
1 parent 3d3bb98 commit 59ed339

File tree

1 file changed

+2
-1
lines changed
  • projects/app/src/pages/api/core/dataset/collection

1 file changed

+2
-1
lines changed

projects/app/src/pages/api/core/dataset/collection/listV2.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { parsePaginationRequest } from '@fastgpt/service/common/api/pagination';
1515
import { type DatasetCollectionSchemaType } from '@fastgpt/global/core/dataset/type';
1616
import { MongoDatasetData } from '@fastgpt/service/core/dataset/data/schema';
1717
import { MongoDatasetTraining } from '@fastgpt/service/core/dataset/training/schema';
18+
import { replaceRegChars } from '@fastgpt/global/common/string/tools';
1819

1920
async function handler(
2021
req: NextApiRequest
@@ -46,7 +47,7 @@ async function handler(
4647
...(selectFolder ? { type: DatasetCollectionTypeEnum.folder } : {}),
4748
...(searchText
4849
? {
49-
name: new RegExp(searchText, 'i')
50+
name: new RegExp(`${replaceRegChars(searchText)}`, 'i')
5051
}
5152
: {
5253
parentId: parentId ? new Types.ObjectId(parentId) : null

0 commit comments

Comments
 (0)