You've already forked golang-saas-starter-kit
mirror of
https://github.com/raseels-repos/golang-saas-starter-kit.git
synced 2025-08-06 22:32:51 +02:00
Fixed validation errors
This commit is contained in:
@ -154,7 +154,17 @@ func newValidator() *validator.Validate {
|
||||
if fl.Field().String() == "invalid" {
|
||||
return false
|
||||
}
|
||||
return ctx.Value(KeyTagUnique).(bool)
|
||||
|
||||
cv := ctx.Value(KeyTagUnique)
|
||||
if cv == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
if v, ok := cv.(bool); ok {
|
||||
return v
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
v.RegisterValidationCtx("unique", fctx)
|
||||
|
||||
|
Reference in New Issue
Block a user