fix template market simple app (#3804)

This commit is contained in:
heheer
2025-02-17 20:56:46 +08:00
committed by GitHub
parent 23949230ee
commit 4447e40364

View File

@@ -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,