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(