From aaa766bcd6b31ccedaa685ee7fa55c153c5e26f7 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 25 Mar 2024 08:55:44 +0100 Subject: [PATCH] fix(typescript-client): improve runScript --- typescript-client/client.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/typescript-client/client.ts b/typescript-client/client.ts index 79320abbbc..a2df2ae7d4 100644 --- a/typescript-client/client.ts +++ b/typescript-client/client.ts @@ -238,7 +238,7 @@ export async function runScriptAsync( } let rootJobId = getEnv("WM_ROOT_FLOW_JOB_ID"); - if (rootJobId != undefined) { + if (rootJobId != undefined && rootJobId != "") { params["root_job"] = rootJobId; } @@ -260,9 +260,7 @@ export async function runScriptAsync( Authorization: `Bearer ${OpenAPI.TOKEN}`, }, body: JSON.stringify(args), - }) - .then((res) => res.json()) - .then((data) => data.id); + }).then((res) => res.text()); } /** * Resolve a resource value in case the default value was picked because the input payload was undefined