Browse Source
Merge pull request #4950 from mslourens/enforce_display_column_validation
fetch the table which contains info about the primaryDisplay
master
Martin McKeaveney
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
11 additions and
0 deletions
-
packages/client/src/components/app/forms/Form.svelte
|
|
|
@ -17,6 +17,7 @@ |
|
|
|
let table |
|
|
|
|
|
|
|
$: fetchSchema(dataSource) |
|
|
|
$: fetchTable(dataSource) |
|
|
|
|
|
|
|
// Returns the closes data context which isn't a built in context |
|
|
|
const getInitialValues = (type, dataSource, context) => { |
|
|
|
@ -74,6 +75,16 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const fetchTable = async dataSource => { |
|
|
|
if (dataSource?.tableId) { |
|
|
|
try { |
|
|
|
table = await API.fetchTableDefinition(dataSource.tableId) |
|
|
|
} catch (error) { |
|
|
|
table = null |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$: initialValues = getInitialValues(actionType, dataSource, $context) |
|
|
|
$: resetKey = Helpers.hashString( |
|
|
|
JSON.stringify(initialValues) + JSON.stringify(schema) |
|
|
|
|