status-go/protocol/requests/toggle_collapsed_community_...

27 lines
731 B
Go
Raw Permalink Normal View History

2023-03-08 17:47:09 +00:00
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
}