Validate that required fields can't be hidden in views
This commit is contained in:
parent
91c20213dc
commit
c1b760ca9e
|
@ -74,7 +74,15 @@ async function guardViewSchema(
|
||||||
}
|
}
|
||||||
|
|
||||||
const viewSchemaField = viewSchema[field.name]
|
const viewSchemaField = viewSchema[field.name]
|
||||||
if (viewSchemaField?.readonly) {
|
|
||||||
|
if (!viewSchemaField?.visible) {
|
||||||
|
throw new HTTPError(
|
||||||
|
`You can't hide the required field "${field.name}"`,
|
||||||
|
400
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewSchemaField.readonly) {
|
||||||
throw new HTTPError(
|
throw new HTTPError(
|
||||||
`You can't make read only the required field "${field.name}"`,
|
`You can't make read only the required field "${field.name}"`,
|
||||||
400
|
400
|
||||||
|
|
Loading…
Reference in New Issue