2021-05-23 13:34:17 +00:00
|
|
|
package requests
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
"github.com/status-im/status-go/eth-node/types"
|
|
|
|
)
|
|
|
|
|
2021-08-25 16:52:28 +00:00
|
|
|
var ErrDeleteCommunityCategoryInvalidCommunityID = errors.New("delete-community-category: invalid community id")
|
|
|
|
var ErrDeleteCommunityCategoryInvalidCategoryID = errors.New("delete-community-category: invalid category id")
|
2021-05-23 13:34:17 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|