status-go/protocol/requests/delete_community_category.go
RichΛrd fe086b2fdd
fix: allow empty category id when sorting chats and fix error messages (#2301)
* fix: allow empty category id when sorting chats and fix error messages
* fix: unordered maps
2021-08-25 12:52:28 -04:00

29 lines
695 B
Go

package requests
import (
"errors"
"github.com/status-im/status-go/eth-node/types"
)
var ErrDeleteCommunityCategoryInvalidCommunityID = errors.New("delete-community-category: invalid community id")
var ErrDeleteCommunityCategoryInvalidCategoryID = errors.New("delete-community-category: invalid category id")
type DeleteCommunityCategory struct {
CommunityID types.HexBytes `json:"communityId"`
CategoryID string `json:"categoryId"`
}
func (j *DeleteCommunityCategory) Validate() error {
if len(j.CommunityID) == 0 {
return ErrDeleteCommunityCategoryInvalidCommunityID
}
if len(j.CategoryID) == 0 {
return ErrDeleteCommunityCategoryInvalidCategoryID
}
return nil
}