From 55e28bdebaedc50128c8bb24163f480baa23f142 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Mon, 23 Oct 2023 23:37:32 -0300 Subject: [PATCH] fix(StorePage/index.tsx): add is_component parameter to handleFork function to properly clone flow with parent fix(StorePage/index.tsx): pass is_component parameter to cloneFLowWithParent function when cloning flow fix(StorePage/index.tsx): log newFlow after cloning with parent fix(StorePage/index.tsx): log parsed response after saving cloned flow to flow store fix(StorePage/index.tsx): pass item.is_component parameter to handleFork function when adding MarketCardComponent fix(StorePage/index.tsx): pass item.id and item.is_component parameters to handleFork function when adding MarketCardComponent fix(StorePage/index.tsx): pass data[0].id and data[0].is_component parameters to handleFork function when clicking test button fix(storeUtils.ts): add is_component parameter to cloneFLowWithParent function to properly set is_component property of cloned flow --- src/frontend/src/pages/StorePage/index.tsx | 18 ++++++++++++------ src/frontend/src/utils/storeUtils.ts | 3 ++- 2 files changed, 14 insertions(+), 7 deletions(-) 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); + }} + /> ))}