[#3790] added MaxSize json field option

This commit is contained in:
Gani Georgiev committed 2023-12-09 22:30:37 +02:00
1 parent b9f391cf85
commit fb2eafe860
42 files changed
+247 -134

No files matched your search

+6 -3
View File
@@ -612,10 +612,13 @@ func (o SelectOptions) IsMultiple() bool {
// -------------------------------------------------------------------
type JsonOptions struct {
MaxSize int `form:"maxSize" json:"maxSize"`
}
func (o JsonOptions) Validate() error {
return nil
return validation.ValidateStruct(&o,
validation.Field(&o.MaxSize, validation.Required, validation.Min(1)),
)
}
// -------------------------------------------------------------------
@@ -623,10 +626,10 @@ func (o JsonOptions) Validate() error {
var _ MultiValuer = (*FileOptions)(nil)
type FileOptions struct {
MaxSelect int `form:"maxSelect" json:"maxSelect"`
MaxSize int `form:"maxSize" json:"maxSize"` // in bytes
MimeTypes []string `form:"mimeTypes" json:"mimeTypes"`
Thumbs []string `form:"thumbs" json:"thumbs"`
MaxSelect int `form:"maxSelect" json:"maxSelect"`
MaxSize int `form:"maxSize" json:"maxSize"`
Protected bool `form:"protected" json:"protected"`
}