mirror of
https://github.com/status-im/status-go.git
synced 2025-01-09 06:12:55 +00:00
27 lines
731 B
Go
27 lines
731 B
Go
package requests
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
var ErrToggleCollapsedCommunityCategoryInvalidCommunityID = errors.New("toggle-collapsed-community-category: invalid community id")
|
|
var ErrToggleCollapsedCommunityCategoryInvalidName = errors.New("toggle-collapsed-community-category: invalid category name")
|
|
|
|
type ToggleCollapsedCommunityCategory struct {
|
|
CommunityID string `json:"communityId"`
|
|
CategoryID string `json:"categoryId"`
|
|
Collapsed bool `json:"collapsed"`
|
|
}
|
|
|
|
func (t *ToggleCollapsedCommunityCategory) Validate() error {
|
|
if len(t.CommunityID) == 0 {
|
|
return ErrToggleCollapsedCommunityCategoryInvalidCommunityID
|
|
}
|
|
|
|
if len(t.CategoryID) == 0 {
|
|
return ErrToggleCollapsedCommunityCategoryInvalidName
|
|
}
|
|
|
|
return nil
|
|
}
|