mirror of
https://github.com/hay-kot/homebox.git
synced 2025-07-21 18:10:28 +00:00
fix failing tests
This commit is contained in:
parent
e71146df3d
commit
3cfd274212
3 changed files with 9 additions and 5 deletions
|
@ -43,7 +43,7 @@ type (
|
|||
NotifierUpdate struct {
|
||||
Name string `json:"name" validate:"required,min=1,max=255"`
|
||||
IsActive bool `json:"isActive"`
|
||||
URL *string `json:"url" extensions:"x-nullable" validate:"omitempty,shoutrrr"`
|
||||
URL *string `json:"url" validate:"omitempty,shoutrrr" extensions:"x-nullable" `
|
||||
}
|
||||
|
||||
NotifierOut struct {
|
||||
|
|
|
@ -11,7 +11,7 @@ var validate *validator.Validate
|
|||
func init() {
|
||||
validate = validator.New()
|
||||
|
||||
validate.RegisterValidation("shoutrrr", func(fl validator.FieldLevel) bool {
|
||||
err := validate.RegisterValidation("shoutrrr", func(fl validator.FieldLevel) bool {
|
||||
prefixes := [...]string{
|
||||
"discord://",
|
||||
"smtp://",
|
||||
|
@ -45,6 +45,10 @@ func init() {
|
|||
return false
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Checks a struct for validation errors and returns any errors the occur. This
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue