Commit 8562bdd9 authored by Florian Pagnoux's avatar Florian Pagnoux
Browse files

Fix routing bugs for arrays

parent 0f19e934
......@@ -7,9 +7,9 @@ import flow from 'lodash.flow';
import sortBy from 'lodash.sortby';
function renderSubParams(item, key, path) {
const subParams = isArray(item.subparams) ? item.subparams : flow([
const subParams = flow([
x => map(x, (subParam, name) => Object.assign({}, subParam, {name})),
x => sortBy(x, subParam => item?.metadata?.order.indexOf(subParam.name))
x => isArray(x) ? x : sortBy(x, subParam => item?.metadata?.order.indexOf(subParam.name))
])(item.subparams)
return map(subParams, subParam => {
......
Supports Markdown
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