new licenceController, moved api handling & renaming things
This commit is contained in:
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/go-playground/validator/v10"
|
||||
)
|
||||
|
||||
func ValidateDriversLicence(fl validator.FieldLevel) bool {
|
||||
func ValidateLicence(fl validator.FieldLevel) bool {
|
||||
fieldValue := fl.Field().String()
|
||||
if len(fieldValue) != 11 {
|
||||
return false
|
||||
|
||||
@@ -14,7 +14,7 @@ func SetupValidators() {
|
||||
v.RegisterValidation("safe_content", ValidateSafeContent)
|
||||
v.RegisterValidation("iban", IBANValidator)
|
||||
v.RegisterValidation("bic", BICValidator)
|
||||
v.RegisterValidation("euDriversLicence", ValidateDriversLicence)
|
||||
v.RegisterValidation("euDriversLicence", ValidateLicence)
|
||||
|
||||
// Register struct-level validations
|
||||
v.RegisterStructValidation(validateUser, models.User{})
|
||||
|
||||
Reference in New Issue
Block a user