From dc71ad261b879ac83fe924d22ad35a51a164a415 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Thu, 25 Apr 2024 15:33:34 -0300 Subject: [PATCH] Fix cleanFlowPool function not being called in CollectionCardComponent --- src/frontend/src/components/cardComponent/index.tsx | 2 ++ src/frontend/src/controllers/API/index.ts | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/components/cardComponent/index.tsx b/src/frontend/src/components/cardComponent/index.tsx index 261cd009e..7c71c110e 100644 --- a/src/frontend/src/components/cardComponent/index.tsx +++ b/src/frontend/src/components/cardComponent/index.tsx @@ -40,6 +40,7 @@ export default function CollectionCardComponent({ const setSuccessData = useAlertStore((state) => state.setSuccessData); const setErrorData = useAlertStore((state) => state.setErrorData); const setValidApiKey = useStoreStore((state) => state.updateValidApiKey); + const cleanFlowPool = useFlowStore((state) => state.CleanFlowPool); const isStore = false; const [loading, setLoading] = useState(false); const [loadingLike, setLoadingLike] = useState(false); @@ -64,6 +65,7 @@ export default function CollectionCardComponent({ if (currentFlowId && playground) { setNodes(currentFlow?.data?.nodes ?? [],true); setEdges(currentFlow?.data?.edges ?? [],true); + cleanFlowPool(); } }, [currentFlowId]); diff --git a/src/frontend/src/controllers/API/index.ts b/src/frontend/src/controllers/API/index.ts index 9dc0b0384..be9572398 100644 --- a/src/frontend/src/controllers/API/index.ts +++ b/src/frontend/src/controllers/API/index.ts @@ -918,10 +918,12 @@ export async function getVerticesOrder( } else if (startNodeId) { config["params"] = { start_component_id: startNodeId }; } + const data = {} if(nodes && Edges){ - config.data = {nodes,Edges} + data["nodes"] = nodes + data["edges"] = Edges } - return await api.get(`${BASE_URL_API}build/${flowId}/vertices`, config); + return await api.post(`${BASE_URL_API}build/${flowId}/vertices`,data, config); } export async function postBuildVertex(