Skip to content

Commit

Permalink
fix: fix wrong spanish error message in validator (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
btfhernandez authored Feb 3, 2025
1 parent fb6593c commit aa7e53a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/utils/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,10 @@ func formatErrorMessage(err validator.FieldError) string {
return fmt.Sprintf("The field '%s' must be one of the following values: %s.", err.Field(), err.Param())
case "required_without":
return fmt.Sprintf("The field '%s' is required when the field '%s' is not provided.", err.Field(), err.Param())
case "max":
return fmt.Sprintf("Max length '%s' for '%s' field.", err.Param(), err.Field())
default:
return fmt.Sprintf("Error en el campo '%s': %s.", err.Field(), err.Tag())
return fmt.Sprintf("Error in field %s : %s / %s.", err.Field(), err.Tag(), err.Param())
}
}

Expand Down

0 comments on commit aa7e53a

Please sign in to comment.