From 55c3927fb5211e1ec78719fd38740eb29e481962 Mon Sep 17 00:00:00 2001 From: Guilherme Caponetto <638737+caponetto@users.noreply.github.com> Date: Tue, 13 Feb 2024 05:12:58 -0300 Subject: [PATCH] fix(orchestrator): filter out `null` values from action input (#1199) fix(orchestrator): filter out undefined/null values from action input --- plugins/orchestrator-backend/src/service/router.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/orchestrator-backend/src/service/router.ts b/plugins/orchestrator-backend/src/service/router.ts index 952ef3900e..fc5082e2f6 100644 --- a/plugins/orchestrator-backend/src/service/router.ts +++ b/plugins/orchestrator-backend/src/service/router.ts @@ -513,10 +513,17 @@ function setupExternalRoutes( const { actionId } = req.params; const instanceId: string | undefined = req.header('kogitoprocinstanceid'); const body: JsonObject = (await req.body) as JsonObject; + + const filteredBody = Object.fromEntries( + Object.entries(body).filter( + ([, value]) => value !== undefined && value !== null, + ), + ); + const result: JsonValue = await scaffolderService.executeAction({ actionId, instanceId, - input: body, + input: filteredBody, }); res.status(200).json(result); });