Skip to content

Commit

Permalink
Merge pull request KelvinTegelaar#2600 from JohnDuprey/dev
Browse files Browse the repository at this point in the history
fix nested array
  • Loading branch information
JohnDuprey authored Jun 25, 2024
2 parents ddf4e54 + f5ebf89 commit 4284f7e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/tables/CippTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -645,9 +645,13 @@ export default function CippTable({
Object.assign(output, flatten(value, newKey))
} else {
if (Array.isArray(value)) {
value.map((item, idx) => {
Object.assign(output, flatten(item, `${newKey}[${idx}]`))
})
if (typeof value[0] === 'object') {
value.map((item, idx) => {
Object.assign(output, flatten(item, `${newKey}[${idx}]`))
})
} else {
output[newKey] = value
}
} else {
output[newKey] = value
}
Expand Down

0 comments on commit 4284f7e

Please sign in to comment.