From fdc799ee2966b4566a5816f26fec24b0884d5e3b Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 19 Feb 2024 11:33:38 -0300 Subject: [PATCH] Add optional nodeId parameter to getVerticesOrder function --- src/frontend/src/controllers/API/index.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/controllers/API/index.ts b/src/frontend/src/controllers/API/index.ts index cd2d2f5fa..5df2ebfa5 100644 --- a/src/frontend/src/controllers/API/index.ts +++ b/src/frontend/src/controllers/API/index.ts @@ -855,9 +855,16 @@ export async function requestLogout() { } export async function getVerticesOrder( - flowId: string + flowId: string, + nodeId?: string | null ): Promise> { - return await api.get(`${BASE_URL_API}build/${flowId}/vertices`); + // nodeId is optional and is a query parameter + // if nodeId is not provided, the API will return all vertices + const config = {}; + if (nodeId) { + config["params"] = { component_id: nodeId }; + } + return await api.get(`${BASE_URL_API}build/${flowId}/vertices`, config); } export async function postBuildVertex(