mirror of
https://github.com/status-im/status-go.git
synced 2025-01-10 06:36:32 +00:00
92032c7158
* create and edit community categories * edit categories order * adding category to chat * Adding categories to json
29 lines
736 B
Go
29 lines
736 B
Go
package requests
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/status-im/status-go/eth-node/types"
|
|
)
|
|
|
|
var ErrCreateCommunityCategoryInvalidCommunityID = errors.New("create-community-category: invalid community id")
|
|
var ErrCreateCommunityCategoryInvalidName = errors.New("create-community-category: invalid category name")
|
|
|
|
type CreateCommunityCategory struct {
|
|
CommunityID types.HexBytes `json:"communityId"`
|
|
CategoryName string `json:"categoryName"`
|
|
ChatIDs []string `json:"chatIds"`
|
|
}
|
|
|
|
func (j *CreateCommunityCategory) Validate() error {
|
|
if len(j.CommunityID) == 0 {
|
|
return ErrCreateCommunityCategoryInvalidCommunityID
|
|
}
|
|
|
|
if len(j.CategoryName) == 0 {
|
|
return ErrCreateCommunityCategoryInvalidName
|
|
}
|
|
|
|
return nil
|
|
}
|