[#2868] fixed unique validator detailed error message not being returned when camelCase field name is used

This commit is contained in:
Gani Georgiev committed 2023-07-06 23:14:18 +03:00
1 parent 08b4fc20a9
commit d77479131a
2 files changed
+120 -9

No files matched your search

+1 -1
View File
@@ -896,7 +896,7 @@ func (form *RecordUpsert) prepareError(err error) error {
c := form.record.Collection()
for _, f := range c.Schema.Fields() {
// blank space to unify multi-columns lookup
if strings.Contains(msg+" ", fmt.Sprintf("%s.%s ", strings.ToLower(c.Name), f.Name)) {
if strings.Contains(msg+" ", strings.ToLower(c.Name+"."+f.Name)) {
validationErrs[f.Name] = validation.NewError("validation_not_unique", "Value must be unique")
}
}