mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
fix template market simple app (#3804)
This commit is contained in:
@@ -95,18 +95,15 @@ const TemplateMarketModal = ({
|
|||||||
const { runAsync: onUseTemplate, loading: isCreating } = useRequest2(
|
const { runAsync: onUseTemplate, loading: isCreating } = useRequest2(
|
||||||
async (template: AppTemplateSchemaType) => {
|
async (template: AppTemplateSchemaType) => {
|
||||||
const templateDetail = await getTemplateMarketItemDetail(template.templateId);
|
const templateDetail = await getTemplateMarketItemDetail(template.templateId);
|
||||||
let workflow = templateDetail.workflow;
|
|
||||||
if (templateDetail.type === AppTypeEnum.simple) {
|
|
||||||
workflow = form2AppWorkflow(workflow, t);
|
|
||||||
}
|
|
||||||
return postCreateApp({
|
return postCreateApp({
|
||||||
parentId,
|
parentId,
|
||||||
avatar: template.avatar,
|
avatar: template.avatar,
|
||||||
name: template.name,
|
name: template.name,
|
||||||
type: template.type as AppTypeEnum,
|
type: template.type as AppTypeEnum,
|
||||||
modules: workflow.nodes || [],
|
modules: templateDetail.workflow.nodes || [],
|
||||||
edges: workflow.edges || [],
|
edges: templateDetail.workflow.edges || [],
|
||||||
chatConfig: workflow.chatConfig
|
chatConfig: templateDetail.workflow.chatConfig
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
webPushTrack.useAppTemplate({
|
webPushTrack.useAppTemplate({
|
||||||
id: res,
|
id: res,
|
||||||
|
Reference in New Issue
Block a user