Don't check required fields at all for calculation views.
This commit is contained in:
parent
e6e25fdf94
commit
f2e78ec4d5
|
@ -114,7 +114,11 @@ async function guardViewSchema(
|
||||||
}
|
}
|
||||||
|
|
||||||
await checkReadonlyFields(table, view)
|
await checkReadonlyFields(table, view)
|
||||||
checkRequiredFields(table, view)
|
|
||||||
|
if (!helpers.views.isCalculationView(view)) {
|
||||||
|
checkRequiredFields(table, view)
|
||||||
|
}
|
||||||
|
|
||||||
checkDisplayField(view)
|
checkDisplayField(view)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,7 +182,7 @@ function checkRequiredFields(
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!helpers.views.isCalculationView(view) && !viewSchemaField?.visible) {
|
if (!viewSchemaField?.visible) {
|
||||||
throw new HTTPError(
|
throw new HTTPError(
|
||||||
`You can't hide "${field.name}" because it is a required field.`,
|
`You can't hide "${field.name}" because it is a required field.`,
|
||||||
400
|
400
|
||||||
|
@ -186,7 +190,6 @@ function checkRequiredFields(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
viewSchemaField &&
|
|
||||||
helpers.views.isBasicViewField(viewSchemaField) &&
|
helpers.views.isBasicViewField(viewSchemaField) &&
|
||||||
viewSchemaField.readonly
|
viewSchemaField.readonly
|
||||||
) {
|
) {
|
||||||
|
|
Loading…
Reference in New Issue