added required validator for the TextField.Pattern option in case it is a primary key

This commit is contained in:
Gani Georgiev
2024-11-19 17:21:25 +02:00
parent 48328bf33f
commit 9fe4f87e5b
8 changed files with 31 additions and 9 deletions

View File

@@ -902,6 +902,9 @@ func (c *Collection) initIdField() {
field.Required = true
field.PrimaryKey = true
field.Hidden = false
if field.Pattern == "" {
field.Pattern = `^[a-z0-9]+$`
}
}
}