feat(09-06): keep relation required flags off unbound columns
- Schema JSON still reports required relations for the client - Save validation only adds required for scalar writable fields
This commit is contained in:
@@ -644,7 +644,9 @@ func mergedRules(cc *CompiledController, model any) map[string]string {
|
||||
return out
|
||||
}
|
||||
for _, field := range cc.Form.Fields {
|
||||
if field.Required {
|
||||
// Relation fields are not writable columns. required stays on the
|
||||
// schema for the client, but it cannot be checked by Fill.
|
||||
if field.Required && scalarFormField(field.Type) {
|
||||
out[field.Name] = mergeRequired(out[field.Name])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user