From d57bf95c7018bda1d080d44cbbeaf1635bba5b86 Mon Sep 17 00:00:00 2001 From: Nima Nakhostin Date: Sat, 29 Nov 2025 12:50:56 +0330 Subject: [PATCH] Update CMSForm Country Field Validation - Modified the validation rule for the Country field in the CMSForm struct to ensure it requires exactly 3 characters, enhancing input validation consistency. - This change improves the robustness of the form handling by enforcing stricter validation criteria. --- internal/cms/form.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cms/form.go b/internal/cms/form.go index fa002f5..aec4d7b 100644 --- a/internal/cms/form.go +++ b/internal/cms/form.go @@ -7,7 +7,7 @@ type CMSForm struct { Key string `json:"key" valid:"required,length(2|100)" example:"SW-001"` Language string `json:"language" valid:"optional,length(2|100)" example:"en"` CompanyName string `json:"company_name" valid:"optional,length(2|100)" example:"Opplens"` - Country string `json:"country" valid:"optional,length(3)" example:"SWE"` + Country string `json:"country" valid:"optional,length(3|3)" example:"SWE"` Type CMSType `json:"type" valid:"optional,in(company|organization)" example:"company"` Hero heroSectionForm `json:"hero" valid:"optional"` Chart chartSectionForm `json:"chart" valid:"optional"`