From 4d044003098c0e16998720819f975c05538878a2 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Mon, 23 Oct 2023 23:47:45 -0300 Subject: [PATCH] fix(StorePage): fix typo in function name from cloneFLowWithParent to cloneFlowWithParent fix(storeUtils): add missing type annotations to function parameters in cloneFlowWithParent function --- src/frontend/src/pages/StorePage/index.tsx | 2 +- src/frontend/src/utils/storeUtils.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) 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 = "";