github.com/status-im/status-go@v1.1.0/protocol/requests/delete_community_category.go (about)

     1  package requests
     2  
     3  import (
     4  	"errors"
     5  
     6  	"github.com/status-im/status-go/eth-node/types"
     7  )
     8  
     9  var ErrDeleteCommunityCategoryInvalidCommunityID = errors.New("delete-community-category: invalid community id")
    10  var ErrDeleteCommunityCategoryInvalidCategoryID = errors.New("delete-community-category: invalid category id")
    11  
    12  type DeleteCommunityCategory struct {
    13  	CommunityID types.HexBytes `json:"communityId"`
    14  	CategoryID  string         `json:"categoryId"`
    15  }
    16  
    17  func (j *DeleteCommunityCategory) Validate() error {
    18  	if len(j.CommunityID) == 0 {
    19  		return ErrDeleteCommunityCategoryInvalidCommunityID
    20  	}
    21  
    22  	if len(j.CategoryID) == 0 {
    23  		return ErrDeleteCommunityCategoryInvalidCategoryID
    24  
    25  	}
    26  
    27  	return nil
    28  }