Fix cleanFlowPool function not being called in CollectionCardComponent

This commit is contained in:
anovazzi1 2024-04-25 15:33:34 -03:00
commit dc71ad261b
2 changed files with 6 additions and 2 deletions

View file

@ -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]);

View file

@ -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(