mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-29 09:44:47 +00:00

* update queue * feat: sync api collection will refresh title * sync collection * remove lock * perf: invite link ux
23 lines
781 B
TypeScript
23 lines
781 B
TypeScript
import { DatasetCollectionTypeEnum } from '../constants';
|
|
import { DatasetCollectionSchemaType } from '../type';
|
|
|
|
export const getCollectionSourceData = (collection?: DatasetCollectionSchemaType) => {
|
|
return {
|
|
sourceId:
|
|
collection?.fileId ||
|
|
collection?.rawLink ||
|
|
collection?.externalFileId ||
|
|
collection?.externalFileUrl ||
|
|
collection?.apiFileId,
|
|
sourceName: collection?.name || ''
|
|
};
|
|
};
|
|
|
|
export const checkCollectionIsFolder = (type: DatasetCollectionTypeEnum) => {
|
|
return type === DatasetCollectionTypeEnum.folder || type === DatasetCollectionTypeEnum.virtual;
|
|
};
|
|
|
|
export const collectionCanSync = (type: DatasetCollectionTypeEnum) => {
|
|
return [DatasetCollectionTypeEnum.link, DatasetCollectionTypeEnum.apiFile].includes(type);
|
|
};
|