Fix mark_branch function and refactor build_and_cache_graph_from_db function (#1833)
* Fix mark_branch function in Graph class to properly handle visited vertices * Refactor build_and_cache_graph_from_db function in utils.py to simplify code and remove unnecessary parameter * Fix retrieval of graph from cache in retrieve_vertices_order function * Fix possible_id type annotation in get_id_from_search_string function * Refactor APIRequest class to improve variable naming and remove unnecessary underscore prefix in headers parameter * Refactor buildVertices function in buildUtils.ts to improve code readability and remove unnecessary variable assignment * Fix API endpoints in test_endpoints.py to use correct HTTP methods
This commit is contained in:
parent
2dc4ffd99f
commit
92d39a6500
7 changed files with 31 additions and 38 deletions
|
|
@ -116,33 +116,29 @@ export async function buildVertices({
|
|||
nodes,
|
||||
edges,
|
||||
}: BuildVerticesParams) {
|
||||
let verticesBuild = useFlowStore.getState().verticesBuild;
|
||||
// if startNodeId and stopNodeId are provided
|
||||
// something is wrong
|
||||
if (startNodeId && stopNodeId) {
|
||||
return;
|
||||
}
|
||||
let verticesOrderResponse = await updateVerticesOrder(
|
||||
flowId,
|
||||
startNodeId,
|
||||
stopNodeId,
|
||||
nodes,
|
||||
edges
|
||||
);
|
||||
if (onValidateNodes) {
|
||||
try {
|
||||
onValidateNodes(verticesOrderResponse.verticesToRun);
|
||||
} catch (e) {
|
||||
useFlowStore.getState().setIsBuilding(false);
|
||||
|
||||
if (!verticesBuild || startNodeId || stopNodeId) {
|
||||
let verticesOrderResponse = await updateVerticesOrder(
|
||||
flowId,
|
||||
startNodeId,
|
||||
stopNodeId,
|
||||
nodes,
|
||||
edges
|
||||
);
|
||||
if (onValidateNodes) {
|
||||
try {
|
||||
onValidateNodes(verticesOrderResponse.verticesToRun);
|
||||
} catch (e) {
|
||||
useFlowStore.getState().setIsBuilding(false);
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (onGetOrderSuccess) onGetOrderSuccess();
|
||||
verticesBuild = useFlowStore.getState().verticesBuild;
|
||||
}
|
||||
if (onGetOrderSuccess) onGetOrderSuccess();
|
||||
let verticesBuild = useFlowStore.getState().verticesBuild;
|
||||
|
||||
const verticesIds = verticesBuild?.verticesIds!;
|
||||
const verticesLayers = verticesBuild?.verticesLayers!;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue