mirror of
https://github.com/foomo/contentfulvalidation.git
synced 2025-10-16 12:25:37 +00:00
fix: typo
This commit is contained in:
parent
291f49393c
commit
feef7a72ce
@ -14,10 +14,10 @@ const (
|
||||
)
|
||||
|
||||
const (
|
||||
MissingQuerryFieldValues QueryError = "Missing field values"
|
||||
QuerryValueExpired QueryError = "Querry field value is expired"
|
||||
MissingQuerryCondition QueryError = "Missing querry condition"
|
||||
MissingQuerryField QueryError = "Querry Field is empty"
|
||||
MissingQueryFieldValues QueryError = "Missing field values"
|
||||
QueryValueExpired QueryError = "Query field value is expired"
|
||||
MissingQueryCondition QueryError = "Missing query condition"
|
||||
MissingQueryField QueryError = "Query Field is empty"
|
||||
)
|
||||
|
||||
const DateFormat = "02 Jan 2006"
|
||||
|
||||
@ -9,10 +9,10 @@ func ValidateQuery(query *catvo.Query, attributes catvo.Attributes) (constants.Q
|
||||
|
||||
isValueExpired := func(value string, def catvo.AttributeDefinition) (constants.QueryError, bool) {
|
||||
if len(value) < 1 {
|
||||
return constants.MissingQuerryFieldValues, true
|
||||
return constants.MissingQueryFieldValues, true
|
||||
}
|
||||
if _, ok := def.EnumStrings[catvo.AttributeValueID(value)]; !ok {
|
||||
return constants.QuerryValueExpired, true
|
||||
return constants.QueryValueExpired, true
|
||||
} else {
|
||||
return "", false
|
||||
}
|
||||
@ -20,7 +20,7 @@ func ValidateQuery(query *catvo.Query, attributes catvo.Attributes) (constants.Q
|
||||
|
||||
areValuesExpired := func(values []string, def catvo.AttributeDefinition) (constants.QueryError, bool) {
|
||||
if len(values) < 1 {
|
||||
return constants.MissingQuerryFieldValues, true
|
||||
return constants.MissingQueryFieldValues, true
|
||||
}
|
||||
for _, v := range values {
|
||||
if res, ok := isValueExpired(v, def); ok {
|
||||
@ -48,10 +48,10 @@ func ValidateQuery(query *catvo.Query, attributes catvo.Attributes) (constants.Q
|
||||
case e.Matcher.StringNotEquals != nil:
|
||||
errorMessage, hasError = isValueExpired(e.Matcher.StringNotEquals.Value, def)
|
||||
default:
|
||||
errorMessage, hasError = constants.MissingQuerryCondition, true
|
||||
errorMessage, hasError = constants.MissingQueryCondition, true
|
||||
}
|
||||
} else {
|
||||
return constants.MissingQuerryField, true
|
||||
return constants.MissingQueryField, true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user