mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
4.8.11 perf (#2832)
* save toast * perf: surya ocr * perf: remove same model name * fix: indexes * perf: ip check * feat: Fixed the version number of the subapplication * feat: simple app get latest child version * perf: update child dispatch variables * feat: variables update doc
This commit is contained in:
@@ -2,7 +2,6 @@ import { AppSchema } from '@fastgpt/global/core/app/type';
|
||||
import { NodeInputKeyEnum } from '@fastgpt/global/core/workflow/constants';
|
||||
import { FlowNodeTypeEnum } from '@fastgpt/global/core/workflow/node/constant';
|
||||
import { getLLMModel } from '../ai/model';
|
||||
import { MongoAppVersion } from './version/schema';
|
||||
import { MongoApp } from './schema';
|
||||
|
||||
export const beforeUpdateAppFormat = <T extends AppSchema['modules'] | undefined>({
|
||||
@@ -46,30 +45,6 @@ export const beforeUpdateAppFormat = <T extends AppSchema['modules'] | undefined
|
||||
};
|
||||
};
|
||||
|
||||
export const getAppLatestVersion = async (appId: string, app?: AppSchema) => {
|
||||
const version = await MongoAppVersion.findOne({
|
||||
appId,
|
||||
isPublish: true
|
||||
})
|
||||
.sort({
|
||||
time: -1
|
||||
})
|
||||
.lean();
|
||||
|
||||
if (version) {
|
||||
return {
|
||||
nodes: version.nodes,
|
||||
edges: version.edges,
|
||||
chatConfig: version.chatConfig || app?.chatConfig || {}
|
||||
};
|
||||
}
|
||||
return {
|
||||
nodes: app?.modules || [],
|
||||
edges: app?.edges || [],
|
||||
chatConfig: app?.chatConfig || {}
|
||||
};
|
||||
};
|
||||
|
||||
/* Get apps */
|
||||
export async function findAppAndAllChildren({
|
||||
teamId,
|
||||
|
Reference in New Issue
Block a user