Fix community assistant parsing errors

This commit is contained in:
akhisud3195 2025-09-15 16:30:35 +04:00
parent 9dee558333
commit 09060d6866

View file

@ -142,9 +142,12 @@ export function BuildAssistantSection() {
}
});
} else if (template.type === 'community') {
// Handle community template import
// Fetch full workflow for community template, then create from JSON
const res = await fetch(`/api/assistant-templates/${template.id}`);
if (!res.ok) throw new Error('Failed to fetch community template details');
const data = await res.json();
await createProjectFromJsonWithOptions({
workflowJson: JSON.stringify(template.workflow),
workflowJson: JSON.stringify(data.workflow),
router,
onSuccess: (projectId) => {
router.push(`/projects/${projectId}/workflow`);