mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 20:37:48 +00:00

* perf: local file create collection * rename middleware * perf: remove code * feat: next14 * feat: external file dataset * collection tags field * external file dataset doc * fix: ts
15 lines
538 B
TypeScript
15 lines
538 B
TypeScript
import { DatasetSourceReadTypeEnum, ImportDataSourceEnum } from './constants';
|
|
|
|
export const importType2ReadType = (type: ImportDataSourceEnum) => {
|
|
if (type === ImportDataSourceEnum.csvTable || type === ImportDataSourceEnum.fileLocal) {
|
|
return DatasetSourceReadTypeEnum.fileLocal;
|
|
}
|
|
if (type === ImportDataSourceEnum.fileLink) {
|
|
return DatasetSourceReadTypeEnum.link;
|
|
}
|
|
if (type === ImportDataSourceEnum.externalFile) {
|
|
return DatasetSourceReadTypeEnum.externalFile;
|
|
}
|
|
return DatasetSourceReadTypeEnum.link;
|
|
};
|