Skip to content
Snippets Groups Projects
Commit acef88a1 authored by stevereis's avatar stevereis
Browse files

Fix : return array on empty value

parent 975954e5
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,8 @@ export const transformToExperiment = jsonata(`
(
$params := ["y", "pathology", "dataset", "filter"];
$toArray := function($x) { $type($x) = 'array' ? $x : [$x]};
{
"name": name,
"uuid": uuid,
......@@ -48,12 +50,13 @@ export const transformToExperiment = jsonata(`
"datasets": $split(algorithm.parameters[name = "dataset"].value, ','),
"algorithm": {
"name": algorithm.name,
"parameters" :
algorithm.parameters[$not(name in $params)].({
"name": name,
"label": label,
"value": $split(value, ',')
})
"parameters" : $toArray(
algorithm.parameters[$not(name in $params)].({
"name": name,
"label": label,
"value": $split(value, ',')
})
)
}
}
)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment