You've already forked pocketbase
mirror of
https://github.com/pocketbase/pocketbase.git
synced 2025-11-25 23:52:32 +02:00
added required validator for the TextField.Pattern option in case it is a primary key
This commit is contained in:
@@ -704,7 +704,7 @@ func TestCollectionValidate(t *testing.T) {
|
||||
collection: func(app core.App) (*core.Collection, error) {
|
||||
c := core.NewBaseCollection("new_auth")
|
||||
c.Fields = core.NewFieldsList(
|
||||
&core.TextField{Name: "id", PrimaryKey: true, Required: true},
|
||||
&core.TextField{Name: "id", PrimaryKey: true, Required: true, Pattern: `\w+`},
|
||||
)
|
||||
return c, nil
|
||||
},
|
||||
@@ -715,7 +715,7 @@ func TestCollectionValidate(t *testing.T) {
|
||||
collection: func(app core.App) (*core.Collection, error) {
|
||||
c := core.NewBaseCollection("new_auth")
|
||||
c.Fields = core.NewFieldsList(
|
||||
&core.TextField{Name: "id", PrimaryKey: true, Required: true},
|
||||
&core.TextField{Name: "id", PrimaryKey: true, Required: true, Pattern: `\w+`},
|
||||
&core.TextField{Id: "f1", Name: "Test"}, // case-insensitive
|
||||
&core.BoolField{Id: "f2", Name: "test"},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user