diff --git a/src/frontend/src/pages/StorePage/index.tsx b/src/frontend/src/pages/StorePage/index.tsx index e0b9c41c1..0c0b425dd 100644 --- a/src/frontend/src/pages/StorePage/index.tsx +++ b/src/frontend/src/pages/StorePage/index.tsx @@ -83,14 +83,15 @@ export default function StorePage(): JSX.Element { const loadingWithApiKey = loading; const renderComponents = !loading; - function handleFork(flowId: string) { + function handleFork(flowId: string, is_component: boolean) { getComponent(flowId).then( (res) => { console.log(res); - const newFLow = cloneFLowWithParent(res); + const newFLow = cloneFLowWithParent(res.data, is_component); + console.log(newFLow); saveFlowStore(newFLow).then( (res) => { - console.log(res); + console.log(JSON.parse(JSON.stringify(res))); addFlow(true, newFLow); }, (error) => { @@ -222,12 +223,17 @@ export default function StorePage(): JSX.Element { filteredCategories.has(f.is_component) ) .map((item, idx) => ( - {}} /> + { + handleFork(item.id, item.is_component); + }} + /> ))}