Commit 4447e403 by heheer Committed by GitHub

fix template market simple app (#3804)

parent 23949230
......@@ -95,18 +95,15 @@ const TemplateMarketModal = ({
const { runAsync: onUseTemplate, loading: isCreating } = useRequest2(
async (template: AppTemplateSchemaType) => {
const templateDetail = await getTemplateMarketItemDetail(template.templateId);
let workflow = templateDetail.workflow;
if (templateDetail.type === AppTypeEnum.simple) {
workflow = form2AppWorkflow(workflow, t);
}
return postCreateApp({
parentId,
avatar: template.avatar,
name: template.name,
type: template.type as AppTypeEnum,
modules: workflow.nodes || [],
edges: workflow.edges || [],
chatConfig: workflow.chatConfig
modules: templateDetail.workflow.nodes || [],
edges: templateDetail.workflow.edges || [],
chatConfig: templateDetail.workflow.chatConfig
}).then((res) => {
webPushTrack.useAppTemplate({
id: res,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment