[#2868] fixed unique validator detailed error message not being returned when camelCase field name is used
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user