Browse Source

fix: slug валидатор разрешает _ (нужен для feature/tag ID)

neyrogovnarik 1 month ago
parent
commit
2ea0839243
1 changed files with 1 additions and 1 deletions
  1. 1 1
      backend/internal/validator/validator.go

+ 1 - 1
backend/internal/validator/validator.go

@@ -14,7 +14,7 @@ import (
 var (
 	validate *validator.Validate
 	uuidRegex     = regexp.MustCompile(`^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$`)
-	slugRegex     = regexp.MustCompile(`^[a-z0-9-]+$`)
+	slugRegex     = regexp.MustCompile(`^[a-z0-9_-]+$`)
 	currencyRegex = regexp.MustCompile(`^[A-Z]{3}$`)
 )