diff --git a/src/frontend/src/pages/StorePage/index.tsx b/src/frontend/src/pages/StorePage/index.tsx index 0c0b425dd..6c0f4c389 100644 --- a/src/frontend/src/pages/StorePage/index.tsx +++ b/src/frontend/src/pages/StorePage/index.tsx @@ -87,7 +87,7 @@ export default function StorePage(): JSX.Element { getComponent(flowId).then( (res) => { console.log(res); - const newFLow = cloneFLowWithParent(res.data, is_component); + const newFLow = cloneFLowWithParent(res.data, res.id, is_component); console.log(newFLow); saveFlowStore(newFLow).then( (res) => { diff --git a/src/frontend/src/utils/storeUtils.ts b/src/frontend/src/utils/storeUtils.ts index 8d074b181..aa8d0c3f7 100644 --- a/src/frontend/src/utils/storeUtils.ts +++ b/src/frontend/src/utils/storeUtils.ts @@ -1,8 +1,11 @@ import { cloneDeep } from "lodash"; import { FlowType } from "../types/flow"; -export default function cloneFLowWithParent(flow: FlowType, is_component) { - const parent = flow.id; +export default function cloneFLowWithParent( + flow: FlowType, + parent: string, + is_component: boolean +) { let childFLow = cloneDeep(flow); childFLow.parent = parent; childFLow.id = "";