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.
This commit is contained in:
@@ -7,7 +7,7 @@ type CMSForm struct {
|
|||||||
Key string `json:"key" valid:"required,length(2|100)" example:"SW-001"`
|
Key string `json:"key" valid:"required,length(2|100)" example:"SW-001"`
|
||||||
Language string `json:"language" valid:"optional,length(2|100)" example:"en"`
|
Language string `json:"language" valid:"optional,length(2|100)" example:"en"`
|
||||||
CompanyName string `json:"company_name" valid:"optional,length(2|100)" example:"Opplens"`
|
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"`
|
Type CMSType `json:"type" valid:"optional,in(company|organization)" example:"company"`
|
||||||
Hero heroSectionForm `json:"hero" valid:"optional"`
|
Hero heroSectionForm `json:"hero" valid:"optional"`
|
||||||
Chart chartSectionForm `json:"chart" valid:"optional"`
|
Chart chartSectionForm `json:"chart" valid:"optional"`
|
||||||
|
|||||||
Reference in New Issue
Block a user