mirror of
https://github.com/labring/FastGPT.git
synced 2026-05-02 01:02:05 +08:00
add templateId to apps (#5866)
* fix: timeselector ui error * var update node * add templateId to apps
This commit is contained in:
@@ -484,7 +484,7 @@ const RenderList = React.memo(function RenderList({
|
||||
_hover={{
|
||||
color: 'primary.600'
|
||||
}}
|
||||
onClick={() => router.push('/toolkit/tools')}
|
||||
onClick={() => router.push('/plugin/tool')}
|
||||
gap={1}
|
||||
bottom={0}
|
||||
right={[3, 6]}
|
||||
|
||||
@@ -39,11 +39,14 @@ export type CreateAppBody = {
|
||||
modules: AppSchema['modules'];
|
||||
edges?: AppSchema['edges'];
|
||||
chatConfig?: AppSchema['chatConfig'];
|
||||
|
||||
templateId?: string;
|
||||
utmParams?: ShortUrlParams;
|
||||
};
|
||||
|
||||
async function handler(req: ApiRequestProps<CreateAppBody>) {
|
||||
const { parentId, name, avatar, intro, type, modules, edges, chatConfig, utmParams } = req.body;
|
||||
const { parentId, name, avatar, intro, type, modules, edges, chatConfig, templateId, utmParams } =
|
||||
req.body;
|
||||
|
||||
if (!name || !type || !Array.isArray(modules)) {
|
||||
return Promise.reject(CommonErrEnum.inheritPermissionError);
|
||||
@@ -122,6 +125,7 @@ export const onCreateApp = async ({
|
||||
pluginData,
|
||||
username,
|
||||
userAvatar,
|
||||
templateId,
|
||||
session
|
||||
}: {
|
||||
parentId?: ParentIdType;
|
||||
@@ -137,6 +141,7 @@ export const onCreateApp = async ({
|
||||
pluginData?: AppSchema['pluginData'];
|
||||
username?: string;
|
||||
userAvatar?: string;
|
||||
templateId?: string;
|
||||
session?: ClientSession;
|
||||
}) => {
|
||||
const create = async (session: ClientSession) => {
|
||||
@@ -154,7 +159,8 @@ export const onCreateApp = async ({
|
||||
chatConfig,
|
||||
type,
|
||||
version: 'v2',
|
||||
pluginData
|
||||
pluginData,
|
||||
templateId
|
||||
}
|
||||
],
|
||||
{ session, ordered: true }
|
||||
|
||||
@@ -74,7 +74,8 @@ const TemplateMarket = ({
|
||||
type: template.type as AppTypeEnum,
|
||||
modules: templateDetail.workflow.nodes || [],
|
||||
edges: templateDetail.workflow.edges || [],
|
||||
chatConfig: templateDetail.workflow.chatConfig
|
||||
chatConfig: templateDetail.workflow.chatConfig,
|
||||
templateId: templateDetail.templateId
|
||||
}).then((res) => {
|
||||
webPushTrack.useAppTemplate({
|
||||
id: res,
|
||||
|
||||
Reference in New Issue
Block a user