From 48c3b3a58df1dc6fa1a678c7e50b9c87ef4f6ede Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 25 Mar 2021 08:14:53 +0000 Subject: [PATCH] Ensure schema provided by DataProvider has name properties for all fields --- packages/standard-components/src/DataProvider.svelte | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/standard-components/src/DataProvider.svelte b/packages/standard-components/src/DataProvider.svelte index 93d884ad5c..e7feb804f3 100644 --- a/packages/standard-components/src/DataProvider.svelte +++ b/packages/standard-components/src/DataProvider.svelte @@ -93,6 +93,13 @@ } else { schema = {} } + + // Ensure all schema fields have a name property + Object.entries(schema).forEach(([key, value]) => { + if (!value.name) { + value.name = key + } + }) }