Files
FastGPT/packages/service/common/system/config/controller.ts
2023-12-27 11:07:39 +08:00

16 lines
492 B
TypeScript

import { SystemConfigsTypeEnum } from '@fastgpt/global/common/system/config/constants';
import { MongoSystemConfigs } from './schema';
import { FastGPTConfigFileType } from '@fastgpt/global/common/system/types';
export const getFastGPTConfigFromDB = async () => {
const res = await MongoSystemConfigs.findOne({
type: SystemConfigsTypeEnum.fastgpt
}).sort({
createTime: -1
});
const config = res?.value || {};
return config as Omit<FastGPTConfigFileType, 'systemEnv'>;
};