fix(typescript-client): improve runScript

This commit is contained in:
Ruben Fiszel
2024-03-25 08:55:44 +01:00
parent b6299a4820
commit aaa766bcd6
+2 -4
View File
@@ -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