Browse Source

Be even more explicit about expecting an array data type for data provider rows

pull/4089/head
Andrew Kingston 5 years ago
parent
commit
f47112e7de
  1. 2
      packages/client/src/components/app/DataProvider.svelte

2
packages/client/src/components/app/DataProvider.svelte

@ -188,7 +188,7 @@
// Field sources will be available from context.
// Enrich non object elements into object to ensure a valid schema.
const data = dataSource?.value || []
if (data[0] && typeof data[0] !== "object") {
if (Array.isArray(data) && data[0] && typeof data[0] !== "object") {
allRows = data.map(value => ({ value }))
} else {
allRows = data

Loading…
Cancel
Save